summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-03-11 13:44:42 +0000
committerRoy Marples <roy@marples.name>2016-03-11 13:44:42 +0000
commit9843976ae092495eb37e397a6f36432411010d00 (patch)
tree00d8f2d78a39057a42d2d9666c2f3e9d82639b5c /ipv6nd.c
parentb48c14b7363ef246351f18458eb9a1657871f69a (diff)
downloaddhcpcd-9843976ae092495eb37e397a6f36432411010d00.tar.xz
Fix compile on older platforms which lack O_CLOEXEC.
Thanks to OBATA Akio.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index 010a8d96..84af56ac 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -189,8 +189,9 @@ ipv6nd_open(struct dhcpcd_ctx *dctx)
ctx = dctx->ipv6;
if (ctx->nd_fd != -1)
return ctx->nd_fd;
- ctx->nd_fd = xsocket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6,
- O_NONBLOCK|O_CLOEXEC);
+#define SOCK_FLAGS SOCK_CLOEXEC | SOCK_NONBLOCK
+ ctx->nd_fd = xsocket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, SOCK_FLAGS);
+#undef SOCK_FLAGS
if (ctx->nd_fd == -1)
return -1;