From: Haiyang Zhang Date: Thu, 2 Jun 2016 19:02:04 +0000 (-0700) Subject: hv_netvsc: Fix VF register on vlan devices X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cb2911fed61497e4d0383355f1c865fcdaa94061;p=linux-beck.git hv_netvsc: Fix VF register on vlan devices Added a condition to avoid vlan devices with same MAC registering as VF. Signed-off-by: Haiyang Zhang Reviewed-by: K. Y. Srinivasan Signed-off-by: David S. Miller --- diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 6a69b5cc9fe2..5ac1267b393f 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1500,6 +1500,10 @@ static int netvsc_netdev_event(struct notifier_block *this, { struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); + /* Avoid Vlan dev with same MAC registering as VF */ + if (event_dev->priv_flags & IFF_802_1Q_VLAN) + return NOTIFY_DONE; + switch (event) { case NETDEV_REGISTER: return netvsc_register_vf(event_dev);