mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-24 18:38:38 +00:00
macvlan: Propagate promiscuity setting to lower devices.
When a macvlan device is placed in promiscuous mode, it currently just sets it's multicast mask to permissive, but doesn't change the state of the lower device. As a result, not all multicast traffic can be received on such device. Additionally, none of a vlan traffic can be received on such device as well. This patch propagates the promiscuous mode setting to lower device so that lower device may receive all packets that macvlan may be interested in. Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2e70aedd3d
commit
efdbd2b30c
@ -599,10 +599,18 @@ static int macvlan_open(struct net_device *dev)
|
|||||||
goto del_unicast;
|
goto del_unicast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dev->flags & IFF_PROMISC) {
|
||||||
|
err = dev_set_promiscuity(lowerdev, 1);
|
||||||
|
if (err < 0)
|
||||||
|
goto clear_multi;
|
||||||
|
}
|
||||||
|
|
||||||
hash_add:
|
hash_add:
|
||||||
macvlan_hash_add(vlan);
|
macvlan_hash_add(vlan);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
clear_multi:
|
||||||
|
dev_set_allmulti(lowerdev, -1);
|
||||||
del_unicast:
|
del_unicast:
|
||||||
dev_uc_del(lowerdev, dev->dev_addr);
|
dev_uc_del(lowerdev, dev->dev_addr);
|
||||||
out:
|
out:
|
||||||
@ -638,6 +646,9 @@ static int macvlan_stop(struct net_device *dev)
|
|||||||
if (dev->flags & IFF_ALLMULTI)
|
if (dev->flags & IFF_ALLMULTI)
|
||||||
dev_set_allmulti(lowerdev, -1);
|
dev_set_allmulti(lowerdev, -1);
|
||||||
|
|
||||||
|
if (dev->flags & IFF_PROMISC)
|
||||||
|
dev_set_promiscuity(lowerdev, -1);
|
||||||
|
|
||||||
dev_uc_del(lowerdev, dev->dev_addr);
|
dev_uc_del(lowerdev, dev->dev_addr);
|
||||||
|
|
||||||
hash_del:
|
hash_del:
|
||||||
@ -696,6 +707,10 @@ static void macvlan_change_rx_flags(struct net_device *dev, int change)
|
|||||||
if (dev->flags & IFF_UP) {
|
if (dev->flags & IFF_UP) {
|
||||||
if (change & IFF_ALLMULTI)
|
if (change & IFF_ALLMULTI)
|
||||||
dev_set_allmulti(lowerdev, dev->flags & IFF_ALLMULTI ? 1 : -1);
|
dev_set_allmulti(lowerdev, dev->flags & IFF_ALLMULTI ? 1 : -1);
|
||||||
|
if (change & IFF_PROMISC)
|
||||||
|
dev_set_promiscuity(lowerdev,
|
||||||
|
dev->flags & IFF_PROMISC ? 1 : -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user