path: root/net/core/dev.c
diff options
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2013-09-25 12:02:44 +0200
committerDavid S. Miller <davem@davemloft.net>2013-09-30 15:08:12 -0400
commita528c219df2e865e178c538c7178961dfed5a13c (patch)
treebea412291c7c60b6651cc16752556aa07f94f4e3 /net/core/dev.c
parente05849512662e789232dafed71ba65729f101e70 (diff)
dev: update __dev_notify_flags() to send rtnl msg
This patch only prepares the next one, there is no functional change. Now, __dev_notify_flags() can also be used to notify flags changes via rtnetlink. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
1 files changed, 6 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 25ab6fe80da2..594a6b0ab3da 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5235,10 +5235,14 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags)
return ret;
-void __dev_notify_flags(struct net_device *dev, unsigned int old_flags)
+void __dev_notify_flags(struct net_device *dev, unsigned int old_flags,
+ unsigned int gchanges)
unsigned int changes = dev->flags ^ old_flags;
+ if (gchanges)
+ rtmsg_ifinfo(RTM_NEWLINK, dev, gchanges);
if (changes & IFF_UP) {
if (dev->flags & IFF_UP)
call_netdevice_notifiers(NETDEV_UP, dev);
@@ -5274,10 +5278,7 @@ int dev_change_flags(struct net_device *dev, unsigned int flags)
return ret;
changes = old_flags ^ dev->flags;
- if (changes)
- rtmsg_ifinfo(RTM_NEWLINK, dev, changes);
- __dev_notify_flags(dev, old_flags);
+ __dev_notify_flags(dev, old_flags, changes);
return ret;