netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: "Linux Kernel Network Developers" <netdev@vger.kernel.org>,
	"Jiří Pírko" <jiri@resnulli.us>,
	"Stephen Hemminger" <stephen@networkplumber.org>
Subject: Re: [Patch iproute2] ipaddress: do not add ifa_flags when not necessary
Date: Fri, 4 Apr 2014 09:52:04 -0700	[thread overview]
Message-ID: <CAM_iQpWyjZFMWC1dBs2x_xfH4DsppHTDBVT9xO7XN5EuVcbKow@mail.gmail.com> (raw)
In-Reply-To: <20140404.095905.2169727474578538143.davem@davemloft.net>

On Fri, Apr 4, 2014 at 6:59 AM, David Miller <davem@davemloft.net> wrote:
> 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.

Right, we should use IFA_FLAGS only when ifa_flags > 0xFF.

Thanks!

      reply	other threads:[~2014-04-04 16:52 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
2014-04-04 16:52   ` Cong Wang [this message]

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=CAM_iQpWyjZFMWC1dBs2x_xfH4DsppHTDBVT9xO7XN5EuVcbKow@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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).