diff mbox

[net-next] dev: advertise rx_flags changes

Message ID 1379946334-4183-1-git-send-email-nicolas.dichtel@6wind.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Nicolas Dichtel Sept. 23, 2013, 2:25 p.m. UTC
There is no netlink message/call to notifier chains when rx_flags are updated,
let's advertise everybody.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/core/dev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Stephen Hemminger Sept. 23, 2013, 7:27 p.m. UTC | #1
On Mon, 23 Sep 2013 16:25:34 +0200
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:

> There is no netlink message/call to notifier chains when rx_flags are updated,
> let's advertise everybody.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>  net/core/dev.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 5c713f2239cc..6c91d3919279 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4818,8 +4818,13 @@ static void dev_change_rx_flags(struct net_device *dev, int flags)
>  {
>  	const struct net_device_ops *ops = dev->netdev_ops;
>  
> -	if ((dev->flags & IFF_UP) && ops->ndo_change_rx_flags)
> -		ops->ndo_change_rx_flags(dev, flags);
> +	if (dev->flags & IFF_UP) {
> +		if (ops->ndo_change_rx_flags)
> +			ops->ndo_change_rx_flags(dev, flags);
> +
> +		call_netdevice_notifiers(NETDEV_CHANGE, dev);
> +		rtmsg_ifinfo(RTM_NEWLINK, dev, flags);
> +	}
>  }
>  
>  static int __dev_set_promiscuity(struct net_device *dev, int inc)

This will cause duplicate notification if IFF_MULTICAST changes:

1. dev_change_flags
      __dev_change_flags
         dev_change_rx_flags
            call_netdevice_notifiers...

2. dev_change_flags
     __dev_notify_flags
        call_netdevice_notifiers...


        
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index 5c713f2239cc..6c91d3919279 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4818,8 +4818,13 @@  static void dev_change_rx_flags(struct net_device *dev, int flags)
 {
 	const struct net_device_ops *ops = dev->netdev_ops;
 
-	if ((dev->flags & IFF_UP) && ops->ndo_change_rx_flags)
-		ops->ndo_change_rx_flags(dev, flags);
+	if (dev->flags & IFF_UP) {
+		if (ops->ndo_change_rx_flags)
+			ops->ndo_change_rx_flags(dev, flags);
+
+		call_netdevice_notifiers(NETDEV_CHANGE, dev);
+		rtmsg_ifinfo(RTM_NEWLINK, dev, flags);
+	}
 }
 
 static int __dev_set_promiscuity(struct net_device *dev, int inc)