Browse Source

Fix "(unregistered net_device): Features changed" message

Fix netdev_update_features() messages on register time by moving
the call further in register_netdevice(). When
netdev->reg_state != NETREG_REGISTERED, netdev_name() returns
"(unregistered netdevice)" even if the dev's name is already filled.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michał Mirosław 14 years ago
parent
commit
8e9b59b219
1 changed files with 2 additions and 2 deletions
  1. 2 2
      net/core/dev.c

+ 2 - 2
net/core/dev.c

@@ -5483,8 +5483,6 @@ int register_netdevice(struct net_device *dev)
 	if (!(dev->wanted_features & NETIF_F_SG))
 	if (!(dev->wanted_features & NETIF_F_SG))
 		dev->wanted_features &= ~NETIF_F_GSO;
 		dev->wanted_features &= ~NETIF_F_GSO;
 
 
-	netdev_update_features(dev);
-
 	/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
 	/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
 	 * vlan_dev_init() will do the dev->features check, so these features
 	 * vlan_dev_init() will do the dev->features check, so these features
 	 * are enabled only if supported by underlying device.
 	 * are enabled only if supported by underlying device.
@@ -5501,6 +5499,8 @@ int register_netdevice(struct net_device *dev)
 		goto err_uninit;
 		goto err_uninit;
 	dev->reg_state = NETREG_REGISTERED;
 	dev->reg_state = NETREG_REGISTERED;
 
 
+	netdev_update_features(dev);
+
 	/*
 	/*
 	 *	Default initial state at registry is that the
 	 *	Default initial state at registry is that the
 	 *	device is present.
 	 *	device is present.