Search Linux Wireless

Re: [PATCH] mac80211: Drop the packets whose source or destination mac address is empty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ming Chen <ming032217@xxxxxxxxx> writes:

> We occasionally found ath9k could receive some packets from Linux IP stack
> with empty source and destination mac address,which will result in the
> driver cannot find the station node in TX complete. And thus, the driver
> will complete this buffer but without updating the block ack window.
>
> To fix this issue, we should drop this kind of error packet before it
> goes into the driver.

s-o-b missing, please read:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#signed-off-by_missing

> ---
>  net/mac80211/tx.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> index db38be1b75fa..0668123e8e85 100644
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> @@ -2481,6 +2481,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
>  	bool tdls_peer;
>  	bool multicast;
>  	u16 info_id = 0;
> +	const int empty_mac[ETH_ALEN] = {0};
>  	struct ieee80211_chanctx_conf *chanctx_conf;
>  	struct ieee80211_sub_if_data *ap_sdata;
>  	enum nl80211_band band;
> @@ -2489,6 +2490,13 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
>  	if (IS_ERR(sta))
>  		sta = NULL;
>  
> +	/* drop this skb when source mac or destination mac is empty */
> +	if (!memcmp(skb->data, empty_mac, ETH_ALEN) ||
> +	    !memcmp(skb->data + ETH_ALEN, empty_mac, ETH_ALEN)) {
> +		ret = -ENOTCONN;
> +		goto free;
> +	}

Can you use is_zero_ether_addr()?

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux