aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index eb7f1a4fefc6..75332b089529 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4865,6 +4865,10 @@ static void rollback_registered_many(struct list_head *head)
4865 */ 4865 */
4866 call_netdevice_notifiers(NETDEV_UNREGISTER, dev); 4866 call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
4867 4867
4868 if (!dev->rtnl_link_ops ||
4869 dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
4870 rtmsg_ifinfo(RTM_DELLINK, dev, ~0U);
4871
4868 /* 4872 /*
4869 * Flush the unicast and multicast chains 4873 * Flush the unicast and multicast chains
4870 */ 4874 */
@@ -5091,7 +5095,9 @@ int register_netdevice(struct net_device *dev)
5091 * Prevent userspace races by waiting until the network 5095 * Prevent userspace races by waiting until the network
5092 * device is fully setup before sending notifications. 5096 * device is fully setup before sending notifications.
5093 */ 5097 */
5094 rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U); 5098 if (!dev->rtnl_link_ops ||
5099 dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
5100 rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U);
5095 5101
5096out: 5102out:
5097 return ret; 5103 return ret;