netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiyou.wangcong@gmail.com
Cc: netdev@vger.kernel.org, jiri@resnulli.us, stephen@networkplumber.org
Subject: Re: [Patch iproute2] ipaddress: do not add ifa_flags when not necessary
Date: Fri, 04 Apr 2014 09:59:05 -0400 (EDT)	[thread overview]
Message-ID: <20140404.095905.2169727474578538143.davem@davemloft.net> (raw)
In-Reply-To: <1396591503-16632-1-git-send-email-xiyou.wangcong@gmail.com>

From: Cong Wang <xiyou.wangcong@gmail.com>
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@resnulli.us>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

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.

  reply	other threads:[~2014-04-04 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04  6:05 [Patch iproute2] ipaddress: do not add ifa_flags when not necessary Cong Wang
2014-04-04 13:59 ` David Miller [this message]
2014-04-04 16:52   ` Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140404.095905.2169727474578538143.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).