wil6210: drop Rx multicast packets that are looped-back to STA
authorDedy Lansky <dlansky@codeaurora.org>
Thu, 23 Aug 2018 11:47:07 +0000 (14:47 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 28 Aug 2018 13:48:16 +0000 (16:48 +0300)
Delivering a looped-back multicast packet to network stack can cause
higher layer protocols to fail like for example IPv6 DAD.
In STA mode, upon receiving Rx multicast packet, check if the source
MAC address is equal to our own MAC address and if so drop the packet.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wil6210/txrx.c

index 6a7943e487fb11ba0fc62966da01d5de66826d0a..e7b003b38f459b3cf60e4ae0a5a725851eeb628b 100644 (file)
@@ -765,7 +765,14 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
                return;
        }
 
-       if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) {
+       if (wdev->iftype == NL80211_IFTYPE_STATION) {
+               if (mcast && ether_addr_equal(eth->h_source, ndev->dev_addr)) {
+                       /* mcast packet looped back to us */
+                       rc = GRO_DROP;
+                       dev_kfree_skb(skb);
+                       goto stats;
+               }
+       } else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) {
                if (mcast) {
                        /* send multicast frames both to higher layers in
                         * local net stack and back to the wireless medium