Unverified Commit e2103b18 by Stéphane Graber Committed by GitHub

Merge pull request #2681 from brauner/2018-10-08/adapt_netns_ifaddrs_to_new_kernel

netns_ifaddrs: support NETLINK_DUMP_STRICT_CHK
parents 373376b2 c6b64720
......@@ -477,6 +477,14 @@ static int __rtnl_enumerate(int link_af, int addr_af, __s32 netns_id,
if (fd < 0)
return -1;
r = setsockopt(fd, SOL_NETLINK, NETLINK_DUMP_STRICT_CHK, &(int){1},
sizeof(int));
if (r < 0 && netns_id >= 0) {
close(fd);
*netnsid_aware = false;
return -1;
}
r = __ifaddrs_netlink_recv(fd, 1, RTM_GETLINK, link_af, netns_id,
&getlink_netnsid_aware, cb, ctx);
if (!r)
......
......@@ -239,6 +239,14 @@ extern int __build_bug_on_failed;
#define prctl_arg(x) ((unsigned long)x)
/* networking */
#ifndef NETLINK_DUMP_STRICT_CHK
#define NETLINK_DUMP_STRICT_CHK 12
#endif
#ifndef SOL_NETLINK
#define SOL_NETLINK 270
#endif
#ifndef IFLA_LINKMODE
#define IFLA_LINKMODE 17
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment