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

Commit a60f9677 authored by Ahmad Masri's avatar Ahmad Masri Committed by Gerrit - the friendly Code Review server
Browse files

wil6210: AP should not forward eapol packets



In AP mode, the driver checks each received frame, in case it is
multicast or unicast packet targeted to one of the AP clients, the
driver does the routing in L2 level. EAPOL packet is plaintext frame
and it should not follow the above role.

When AP receives an EAPOL packet that is multicast or targeted to
a client in the AP network, the driver should not forward this packet
immediately in L2. EAPOL packet should be indicated to the network
stack which will check the packet validity and will decide if to forward
the packet to its client or not.

Change-Id: I0edf339c3be5a2300e7b8168866286e71045c0d5
Signed-off-by: default avatarAhmad Masri <amasri@codeaurora.org>
parent 42140f16
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, 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
@@ -792,7 +792,9 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
			dev_kfree_skb(skb);
			goto stats;
		}
	} else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) {
	} else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate &&
		   /* pass EAPOL packets to local net stack only */
		   (wil_skb_get_protocol(skb) != htons(ETH_P_PAE))) {
		if (mcast) {
			/* send multicast frames both to higher layers in
			 * local net stack and back to the wireless medium
+8 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2021, 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
@@ -560,6 +560,13 @@ static inline int wil_ring_is_full(struct wil_ring *ring)
	return wil_ring_next_tail(ring) == ring->swhead;
}

static inline __be16 wil_skb_get_protocol(struct sk_buff *skb)
{
	struct ethhdr *eth = (void *)skb->data;

	return eth->h_proto;
}

static inline bool wil_need_txstat(struct sk_buff *skb)
{
	struct ethhdr *eth = (void *)skb->data;