vlan: Match underlying dev carrier on vlan add

When adding a new vlan, if the underlying interface has no carrier,
then the newly added vlan interface should also have no carrier.
At present, this is not true - the newly added vlan is added with
carrier up.  Fix by checking state of real device.

Signed-off-by: Phil Oester <kernel@linuxace.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Phil Oester 2010-08-17 18:45:08 +00:00 коммит произвёл David S. Miller
Родитель 0645bab7da
Коммит 0ac820eebe
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -510,6 +510,7 @@ static int vlan_dev_open(struct net_device *dev)
if (vlan->flags & VLAN_FLAG_GVRP)
vlan_gvrp_request_join(dev);
if (netif_carrier_ok(real_dev))
netif_carrier_on(dev);
return 0;