From: David Ahern <dsahern@gmail.com>
To: Xin Long <lucien.xin@gmail.com>, network dev <netdev@vger.kernel.org>
Cc: davem@davemloft.net, hannes@stressinduktion.org,
Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: Re: [PATCH net 5/6] rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink
Date: Sun, 15 Oct 2017 19:17:28 -0600 [thread overview]
Message-ID: <f3e88287-e2b8-06a9-a139-7a528749ef9e@gmail.com> (raw)
In-Reply-To: <22c0aefe18d4451166c5f12714d8520346a63f2b.1508062280.git.lucien.xin@gmail.com>
[ cc'ed Nicolas ]
On 10/15/17 4:13 AM, Xin Long wrote:
> The check 'status & DO_SETLINK_NOTIFY' in do_setlink doesn't really
> work after status & DO_SETLINK_MODIFIED, as:
>
> DO_SETLINK_MODIFIED 0x1
> DO_SETLINK_NOTIFY 0x3
>
> Considering that notifications are suppposed to be sent only when
> status have the flag DO_SETLINK_NOTIFY, the right check would be:
>
> (status & DO_SETLINK_NOTIFY) == DO_SETLINK_NOTIFY
>
> This would avoid lots of duplicated notifications when setting some
> properties of a link.
>
> Fixes: ba9989069f4e ("rtnl/do_setlink(): notify when a netdev is modified")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/core/rtnetlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index ab98c1c..3e98fb5 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -2248,7 +2248,7 @@ static int do_setlink(const struct sk_buff *skb,
>
> errout:
> if (status & DO_SETLINK_MODIFIED) {
> - if (status & DO_SETLINK_NOTIFY)
> + if ((status & DO_SETLINK_NOTIFY) == DO_SETLINK_NOTIFY)
> netdev_state_change(dev);
>
> if (err < 0)
>
Good catch.
Acked-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2017-10-16 1:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-15 10:13 [PATCH net 0/6] rtnetlink: a bunch of fixes for userspace notifications in changing dev properties Xin Long
2017-10-15 10:13 ` [PATCH net 1/6] rtnetlink: bring NETDEV_CHANGEMTU event process back in rtnetlink_event Xin Long
2017-10-15 10:13 ` [PATCH net 2/6] rtnetlink: bring NETDEV_CHANGE_TX_QUEUE_LEN " Xin Long
2017-10-15 10:13 ` [PATCH net 3/6] rtnetlink: bring NETDEV_POST_TYPE_CHANGE " Xin Long
2017-10-15 10:13 ` [PATCH net 4/6] rtnetlink: bring NETDEV_CHANGEUPPER " Xin Long
2017-10-15 10:13 ` [PATCH net 5/6] rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink Xin Long
2017-10-15 10:13 ` [PATCH net 6/6] rtnetlink: do not set notification for tx_queue_len " Xin Long
2017-10-16 1:17 ` David Ahern
2017-10-16 1:17 ` David Ahern [this message]
2017-10-16 12:20 ` [PATCH net 5/6] rtnetlink: check DO_SETLINK_NOTIFY correctly " Nicolas Dichtel
2017-10-26 6:52 ` Vlad Yasevich
2017-10-26 7:41 ` Nicolas Dichtel
2017-10-26 8:21 ` [PATCH net] Revert "rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink" Nicolas Dichtel
2017-10-26 9:10 ` Xin Long
2017-10-26 10:18 ` Nicolas Dichtel
2017-10-26 15:22 ` David Ahern
2017-10-27 13:27 ` David Miller
2017-10-26 14:59 ` [PATCH net 5/6] rtnetlink: check DO_SETLINK_NOTIFY correctly in do_setlink David Ahern
2017-10-16 1:16 ` [PATCH net 4/6] rtnetlink: bring NETDEV_CHANGEUPPER event process back in rtnetlink_event David Ahern
2017-10-16 1:16 ` [PATCH net 3/6] rtnetlink: bring NETDEV_POST_TYPE_CHANGE " David Ahern
2017-10-16 1:16 ` [PATCH net 2/6] rtnetlink: bring NETDEV_CHANGE_TX_QUEUE_LEN " David Ahern
2017-10-16 19:49 ` [PATCH net 0/6] rtnetlink: a bunch of fixes for userspace notifications in changing dev properties David Miller
2017-10-24 20:44 ` Stefano Brivio
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=f3e88287-e2b8-06a9-a139-7a528749ef9e@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.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).