From: Alexander Duyck Date: Thu, 25 Apr 2013 12:07:10 +0000 (+0000) Subject: libnetlink: Use ifinfomsg instead of rtgenmsg in rtnl_wilddump_req_filter X-Git-Tag: v3.9.0~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63338dca45135c85c7f588bd5068e6e77ff816eb;p=thirdparty%2Fiproute2.git libnetlink: Use ifinfomsg instead of rtgenmsg in rtnl_wilddump_req_filter This change corrects a kernel incompatibility that was resulting in the ext_filter_mask not being correctly discovered by the kernel as it is buried somewhere in the ifinfomsg. Reported-by: Or Gerlitz Signed-off-by: Alexander Duyck Acked-by: David S. Miller --- diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 04201cdc7..b17e1aae9 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -99,7 +99,7 @@ int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type, { struct { struct nlmsghdr nlh; - struct rtgenmsg g; + struct ifinfomsg ifm; /* attribute has to be NLMSG aligned */ struct rtattr ext_req __attribute__ ((aligned(NLMSG_ALIGNTO))); __u32 ext_filter_mask; @@ -111,7 +111,7 @@ int rtnl_wilddump_req_filter(struct rtnl_handle *rth, int family, int type, req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST; req.nlh.nlmsg_pid = 0; req.nlh.nlmsg_seq = rth->dump = ++rth->seq; - req.g.rtgen_family = family; + req.ifm.ifi_family = family; req.ext_req.rta_type = IFLA_EXT_MASK; req.ext_req.rta_len = RTA_LENGTH(sizeof(__u32));