summaryrefslogtreecommitdiffhomepage
path: root/src/ndp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ndp.c')
-rw-r--r--src/ndp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ndp.c b/src/ndp.c
index 10acc3b..f2bf19c 100644
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -64,7 +64,11 @@ int init_ndp(void)
int val = 256 * 1024;
// Setup netlink socket
- if ((rtnl_event.uloop.fd = odhcpd_open_rtnl()) < 0)
+ if ((rtnl_event.uloop.fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE)) < 0)
+ return -1;
+
+ struct sockaddr_nl nl = {.nl_family = AF_NETLINK};
+ if (connect(rtnl_event.uloop.fd, (struct sockaddr*)&nl, sizeof(nl)) < 0)
return -1;
if (setsockopt(rtnl_event.uloop.fd, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)))