瀏覽代碼

[VLAN]: Don't synchronize addresses while the vlan device is down

While the VLAN device is down, the unicast addresses are not configured
on the underlying device, so we shouldn't attempt to sync them.

Noticed by Dmitry Butskoy <buc@odusz.so-cdu.ru>

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 18 年之前
父節點
當前提交
d932e04a5e
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      net/8021q/vlan.c

+ 4 - 0
net/8021q/vlan.c

@@ -636,6 +636,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 			if (!vlandev)
 			if (!vlandev)
 				continue;
 				continue;
 
 
+			flgs = vlandev->flags;
+			if (!(flgs & IFF_UP))
+				continue;
+
 			vlan_sync_address(dev, vlandev);
 			vlan_sync_address(dev, vlandev);
 		}
 		}
 		break;
 		break;