On Fri, Apr 4, 2014 at 6:59 AM, David Miller <davem@xxxxxxxxxxxxx> wrote: > From: Cong Wang <xiyou.wangcong@xxxxxxxxx> > Date: Thu, 3 Apr 2014 23:05:03 -0700 > >> commit 37c9b94ed21d5779acc23d89a4 (add support for extended ifa_flags) >> introduced a regression: >> >> # ./ip/ip addr add 192.168.0.1/24 dev eth0 >> RTNETLINK answers: Invalid argument >> >> This is due to old kernels don't support IFA_FLAGS flag, it should be skipped >> if we don't use this feature at all. >> >> Cc: Jiri Pirko <jiri@xxxxxxxxxxx> >> Cc: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx> >> Signed-off-by: Cong Wang <xiyou.wangcong@xxxxxxxxx> > > Your patch doesn't really fully fix the problem. > > If the kernel rejects because of presence of the IFA_FLAGS attribute, > it will do so for all such cases. > > Therefore the guard you need is not whether ifa_flags is NULL, but > whether a large enough flag bit is set such that IFA_FLAGS is required. > > IFA_FLAGS was added because ifa.ifa_flags is too small for the new > values we needed to add. Right, we should use IFA_FLAGS only when ifa_flags > 0xFF. Thanks! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html