summaryrefslogtreecommitdiffstats
path: root/if-bsd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-04-18 06:14:55 +0000
committerRoy Marples <roy@marples.name>2016-04-18 06:14:55 +0000
commit9f7184c4293d3a68ff31876a45462ae90b3b4936 (patch)
tree75f7baf07c5d04f0d6ab8953e554f1732dd1bfbc /if-bsd.c
parentcaf646d455672631f61f5da4de25597c43d0e1a7 (diff)
downloaddhcpcd-9f7184c4293d3a68ff31876a45462ae90b3b4936.tar.xz
Fix compile on BSD.
Diffstat (limited to 'if-bsd.c')
-rw-r--r--if-bsd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/if-bsd.c b/if-bsd.c
index 0930b955..0e9617e6 100644
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -133,7 +133,7 @@ if_opensockets_os(struct dhcpcd_ctx *ctx)
ctx->priv = priv;
#ifdef INET6
- priv->pf_inet6_fd = xsocket(PF_INET6, SOCK_DGRAM, 0, SOCK_CLOEXEC);
+ priv->pf_inet6_fd = xsocket(PF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0);
/* Don't return an error so we at least work on kernels witout INET6
* even though we expect INET6 support.
* We will fail noisily elsewhere anyway. */
@@ -141,8 +141,9 @@ if_opensockets_os(struct dhcpcd_ctx *ctx)
priv->pf_inet6_fd = -1;
#endif
- ctx->link_fd = xsocket(PF_ROUTE, SOCK_RAW, 0,
- SOCK_CLOEXEC | SOCK_NONBLOCK);
+#define SOCK_FLAGS (SOCK_CLOEXEC | SOCK_NONBLOCK)
+ ctx->link_fd = xsocket(PF_ROUTE, SOCK_RAW | SOCK_FLAGS, 0);
+#undef SOCK_FLAGS
return ctx->link_fd == -1 ? -1 : 0;
}