From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Ming Chen <ming032217@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Ming Chen <ming.chen@watchguard.com>
Subject: Re: [PATCH v4] mac80211: Drop the packets whose source or destination mac address is empty
Date: Mon, 18 Nov 2019 12:32:39 +0100 [thread overview]
Message-ID: <87blt9ctd4.fsf@toke.dk> (raw)
In-Reply-To: <20191116060833.45752-1-ming.chen@watchguard.com>
Ming Chen <ming032217@gmail.com> writes:
> We found ath9k could occasionally receive some frames from Linux IP stack with empty source
> and destination mac address, especially when the radio mode works as a wireless client and
> configure a static IP. If the ADDBA has been negotiated, this kind of error packets will cause
> the driver failed to find the opposite node (VAP) while in the function of processing these frame's TX
> complete interrupt.
>
> The above failure happens inside the TX complete processing
> function ath_tx_process_buffer while calling ieee80211_find_sta_by_ifaddr.
> Inside the function ieee80211_find_sta_by_ifaddr,
> the condition of ether_addr_equal(sta->sdata->vif.addr, localaddr) will return false
> since localaddr(hdr->addr2, 802.3 source mac) is an empty mac address.
>
> Finally, this function will return NULL to ath_tx_process_buffer.
> And then ath_tx_process_buffer will call ath_tx_complete_aggr to complete the frame(s),
> However, the sta is NULL at this moment, so it could complete this kind
> of the frame(s) but doesn't (and cannot) update the BA window.
> Please see the below snippet of ath_tx_complete_aggr
> if (!sta) {
> INIT_LIST_HEAD(&bf_head);
> while (bf) {
> bf_next = bf->bf_next;
>
> if (!bf->bf_state.stale || bf_next != NULL)
> list_move_tail(&bf->list, &bf_head);
>
> ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, ts, 0);
>
> bf = bf_next;
> }
> return;
> }
>
> To fix this issue, we could remove the comparison of localaddr of ieee80211_find_sta_by_ifaddr
> when works as a wireless client - it won't have more than one sta (VAP) found, but I don't think
> it is the best solution.
Ah, so the TX path doesn't do any lookups when the device is a sta, but
the TX completion path does? This was the information I was looking for;
please explain this in the commit message, you don't need to paste in
the code :)
> Dropping this kind of error packet before it goes into the driver,
> should be the right direction.
So I still wonder why this happens from higher up in the stack. If
there's a legitimate reason, maybe dropping the packet is not the right
thing? And if there is *no* legitimate reason, maybe the packet should
be dropped higher up in the stack instead?
What kind of packets does this happen with?
-Toke
next prev parent reply other threads:[~2019-11-18 11:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-16 6:08 [PATCH v4] mac80211: Drop the packets whose source or destination mac address is empty Ming Chen
2019-11-18 11:32 ` Toke Høiland-Jørgensen [this message]
2019-11-18 12:15 ` Johannes Berg
2019-11-19 8:03 ` Ming Chen
2019-11-19 9:41 ` Kalle Valo
[not found] ` <0101016e8309e9b1-7bb90226-11bb-4b89-8236-952999e578a8-000000@us-west-2.amazonses.com>
2019-11-20 7:11 ` Ming Chen
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=87blt9ctd4.fsf@toke.dk \
--to=toke@redhat.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=ming.chen@watchguard.com \
--cc=ming032217@gmail.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).