aboutgitcodebugslistschat
path: root/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'netlink.c')
-rw-r--r--netlink.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/netlink.c b/netlink.c
index c3c830e..0863734 100644
--- a/netlink.c
+++ b/netlink.c
@@ -1206,24 +1206,23 @@ static void nl_neigh_msg_read(const struct ctx *c, struct nlmsghdr *nh)
* @proto: Protocol, AF_INET or AF_INET6
* @ifi: Interface index
*/
-static void nl_neigh_sync(const struct ctx *c, int proto, int ifi)
+static void nl_neigh_sync(const struct ctx *c, int proto)
{
struct {
struct nlmsghdr nlh;
struct ndmsg ndm;
} req = {
- .ndm.ndm_family = proto,
- .ndm.ndm_ifindex = ifi,
+ .ndm.ndm_family = proto,
};
struct nlmsghdr *nh;
char buf[NLBUFSIZ];
ssize_t status;
uint32_t seq;
- seq = nl_send(nl_sock_neigh, &req, RTM_GETNEIGH,
- NLM_F_DUMP, sizeof(req));
- nl_foreach_oftype(nh, status, nl_sock_neigh, buf, seq, RTM_NEWNEIGH)
+ seq = nl_send(nl_sock, &req, RTM_GETNEIGH, NLM_F_DUMP, sizeof(req));
+ nl_foreach_oftype(nh, status, nl_sock, buf, seq, RTM_NEWNEIGH)
nl_neigh_msg_read(c, nh);
+
if (status < 0)
warn("netlink: RTM_GETNEIGH failed: %s", strerror_(-status));
}
@@ -1298,8 +1297,8 @@ int nl_neigh_notify_init(const struct ctx *c)
return -1;
}
- nl_neigh_sync(c, AF_INET, c->ifi4);
- nl_neigh_sync(c, AF_INET6, c->ifi6);
+ nl_neigh_sync(c, AF_INET);
+ nl_neigh_sync(c, AF_INET6);
return 0;
}