linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maya Erez <merez@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Dedy Lansky <dlansky@codeaurora.org>,
	linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
	Maya Erez <merez@codeaurora.org>
Subject: [PATCH 3/9] wil6210: drop Rx multicast packets that are looped-back to STA
Date: Thu, 23 Aug 2018 14:47:07 +0300	[thread overview]
Message-ID: <1535024833-15178-4-git-send-email-merez@codeaurora.org> (raw)
In-Reply-To: <1535024833-15178-1-git-send-email-merez@codeaurora.org>

From: Dedy Lansky <dlansky@codeaurora.org>

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>
---
 drivers/net/wireless/ath/wil6210/txrx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index 6a7943e..e7b003b38 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -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
-- 
1.9.1

  parent reply	other threads:[~2018-08-23 15:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23 11:47 [PATCH 0/9] wil6210 patches Maya Erez
2018-08-23 11:47 ` [PATCH 1/9] wil6210: remove reset file from debugfs Maya Erez
2018-08-28 13:49   ` Kalle Valo
2018-08-23 11:47 ` [PATCH 2/9] wil6210: add support for channel 4 Maya Erez
2018-08-23 11:47 ` Maya Erez [this message]
2018-08-23 11:47 ` [PATCH 4/9] wil6210: set edma variables only for Talyn-MB devices Maya Erez
2018-08-23 11:47 ` [PATCH 5/9] wil6210: allocate rx reorder buffer only if rx reorder is enabled Maya Erez
2018-08-23 11:47 ` [PATCH 6/9] wil6210: prevent usage of tx ring 0 for eDMA Maya Erez
2018-08-23 11:47 ` [PATCH 7/9] wil6210: fix RX buffers release and unmap Maya Erez
2018-08-23 11:47 ` [PATCH 8/9] wil6210: add FT roam support for AP and station Maya Erez
2018-08-23 11:47 ` [PATCH 9/9] wil6210: fix invalid memory access for rx_buff_mgmt debugfs Maya Erez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1535024833-15178-4-git-send-email-merez@codeaurora.org \
    --to=merez@codeaurora.org \
    --cc=dlansky@codeaurora.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wil6210@qti.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).