aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2018-03-02 16:49:08 -0500
committerDavid S. Miller <davem@davemloft.net>2018-03-04 22:18:21 -0500
commit009f766ca2383d8788acd65c2c36c51bbfb19470 (patch)
tree299914e3a2eeccb771e19256880e8080230851e3
parentb3bf5666a51068ad5ddd89a76ed877101ef3bc16 (diff)
hv_netvsc: filter multicast/broadcast
The netvsc driver was always enabling all multicast and broadcast even if netdevice flag had not enabled it. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/hyperv/rndis_filter.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 1cba767c6453..8927c483c217 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -854,15 +854,19 @@ static void rndis_set_multicast(struct work_struct *w)
854{ 854{
855 struct rndis_device *rdev 855 struct rndis_device *rdev
856 = container_of(w, struct rndis_device, mcast_work); 856 = container_of(w, struct rndis_device, mcast_work);
857 u32 filter = NDIS_PACKET_TYPE_DIRECTED;
858 unsigned int flags = rdev->ndev->flags;
857 859
858 if (rdev->ndev->flags & IFF_PROMISC) 860 if (flags & IFF_PROMISC) {
859 rndis_filter_set_packet_filter(rdev, 861 filter = NDIS_PACKET_TYPE_PROMISCUOUS;
860 NDIS_PACKET_TYPE_PROMISCUOUS); 862 } else {
861 else 863 if (flags & IFF_ALLMULTI)
862 rndis_filter_set_packet_filter(rdev, 864 flags |= NDIS_PACKET_TYPE_ALL_MULTICAST;
863 NDIS_PACKET_TYPE_BROADCAST | 865 if (flags & IFF_BROADCAST)
864 NDIS_PACKET_TYPE_ALL_MULTICAST | 866 flags |= NDIS_PACKET_TYPE_BROADCAST;
865 NDIS_PACKET_TYPE_DIRECTED); 867 }
868
869 rndis_filter_set_packet_filter(rdev, filter);
866} 870}
867 871
868void rndis_filter_update(struct netvsc_device *nvdev) 872void rndis_filter_update(struct netvsc_device *nvdev)