|
@@ -4865,6 +4865,10 @@ static void rollback_registered_many(struct list_head *head)
|
|
|
*/
|
|
|
call_netdevice_notifiers(NETDEV_UNREGISTER, dev);
|
|
|
|
|
|
+ if (!dev->rtnl_link_ops ||
|
|
|
+ dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
|
|
|
+ rtmsg_ifinfo(RTM_DELLINK, dev, ~0U);
|
|
|
+
|
|
|
/*
|
|
|
* Flush the unicast and multicast chains
|
|
|
*/
|
|
@@ -5091,7 +5095,9 @@ int register_netdevice(struct net_device *dev)
|
|
|
* Prevent userspace races by waiting until the network
|
|
|
* device is fully setup before sending notifications.
|
|
|
*/
|
|
|
- rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U);
|
|
|
+ if (!dev->rtnl_link_ops ||
|
|
|
+ dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
|
|
|
+ rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U);
|
|
|
|
|
|
out:
|
|
|
return ret;
|