aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--net/core/dev.c11
-rw-r--r--net/core/rtnetlink.c3
3 files changed, 10 insertions, 8 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b4cfb63f264e..f44f99a69977 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2378,7 +2378,9 @@ extern int dev_ethtool(struct net *net, struct ifreq *);
2378extern unsigned int dev_get_flags(const struct net_device *); 2378extern unsigned int dev_get_flags(const struct net_device *);
2379extern int __dev_change_flags(struct net_device *, unsigned int flags); 2379extern int __dev_change_flags(struct net_device *, unsigned int flags);
2380extern int dev_change_flags(struct net_device *, unsigned int); 2380extern int dev_change_flags(struct net_device *, unsigned int);
2381extern void __dev_notify_flags(struct net_device *, unsigned int old_flags); 2381void __dev_notify_flags(struct net_device *,
2382 unsigned int old_flags,
2383 unsigned int gchanges);
2382extern int dev_change_name(struct net_device *, const char *); 2384extern int dev_change_name(struct net_device *, const char *);
2383extern int dev_set_alias(struct net_device *, const char *, size_t); 2385extern int dev_set_alias(struct net_device *, const char *, size_t);
2384extern int dev_change_net_namespace(struct net_device *, 2386extern int dev_change_net_namespace(struct net_device *,
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)
5235 return ret; 5235 return ret;
5236} 5236}
5237 5237
5238void __dev_notify_flags(struct net_device *dev, unsigned int old_flags) 5238void __dev_notify_flags(struct net_device *dev, unsigned int old_flags,
5239 unsigned int gchanges)
5239{ 5240{
5240 unsigned int changes = dev->flags ^ old_flags; 5241 unsigned int changes = dev->flags ^ old_flags;
5241 5242
5243 if (gchanges)
5244 rtmsg_ifinfo(RTM_NEWLINK, dev, gchanges);
5245
5242 if (changes & IFF_UP) { 5246 if (changes & IFF_UP) {
5243 if (dev->flags & IFF_UP) 5247 if (dev->flags & IFF_UP)
5244 call_netdevice_notifiers(NETDEV_UP, dev); 5248 call_netdevice_notifiers(NETDEV_UP, dev);
@@ -5274,10 +5278,7 @@ int dev_change_flags(struct net_device *dev, unsigned int flags)
5274 return ret; 5278 return ret;
5275 5279
5276 changes = old_flags ^ dev->flags; 5280 changes = old_flags ^ dev->flags;
5277 if (changes) 5281 __dev_notify_flags(dev, old_flags, changes);
5278 rtmsg_ifinfo(RTM_NEWLINK, dev, changes);
5279
5280 __dev_notify_flags(dev, old_flags);
5281 return ret; 5282 return ret;
5282} 5283}
5283EXPORT_SYMBOL(dev_change_flags); 5284EXPORT_SYMBOL(dev_change_flags);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 2a0e21de3060..4aedf03da052 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1647,9 +1647,8 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
1647 } 1647 }
1648 1648
1649 dev->rtnl_link_state = RTNL_LINK_INITIALIZED; 1649 dev->rtnl_link_state = RTNL_LINK_INITIALIZED;
1650 rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U);
1651 1650
1652 __dev_notify_flags(dev, old_flags); 1651 __dev_notify_flags(dev, old_flags, ~0U);
1653 return 0; 1652 return 0;
1654} 1653}
1655EXPORT_SYMBOL(rtnl_configure_link); 1654EXPORT_SYMBOL(rtnl_configure_link);