Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a27403d authored by Dedy Lansky's avatar Dedy Lansky Committed by Lior David
Browse files

wil6210: drop Rx multicast packets that are looped-back to STA



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.

Change-Id: I2b15dcd7e20a289d9a26d31bdddfa2559f1aa43d
Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
[liord@codeaurora.org: SPDX license]
Signed-off-by: default avatarLior David <liord@codeaurora.org>
parent 7177ecf3
Loading
Loading
Loading
Loading
+10 −14
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/etherdevice.h>
@@ -765,7 +754,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