* [PATCH] mac80211: simplify station assignment in ieee80211_tx_prepare()
@ 2015-02-23 23:33 Johannes Berg
2015-02-27 19:55 ` Jouni Malinen
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2015-02-23 23:33 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
There's no need for the second conditional as the same will be
done immediately afterwards if there's no station assigned.
Remove the useless conditional, move fallback assignment into
the else branch and don't try to look up a multicast address
which cannot be found anyway.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/tx.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 88a18ffe2975..76b95ce23113 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1167,13 +1167,9 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
tx->sta = rcu_dereference(sdata->u.vlan.sta);
if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
return TX_DROP;
- } else if (info->flags & (IEEE80211_TX_CTL_INJECTED |
- IEEE80211_TX_INTFL_NL80211_FRAME_TX) ||
- tx->sdata->control_port_protocol == tx->skb->protocol) {
+ } else if (!is_multicast_ether_addr(hdr->addr1)) {
tx->sta = sta_info_get_bss(sdata, hdr->addr1);
}
- if (!tx->sta)
- tx->sta = sta_info_get(sdata, hdr->addr1);
if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
!ieee80211_is_qos_nullfunc(hdr->frame_control) &&
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mac80211: simplify station assignment in ieee80211_tx_prepare()
2015-02-23 23:33 [PATCH] mac80211: simplify station assignment in ieee80211_tx_prepare() Johannes Berg
@ 2015-02-27 19:55 ` Jouni Malinen
0 siblings, 0 replies; 2+ messages in thread
From: Jouni Malinen @ 2015-02-27 19:55 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Johannes Berg
On Tue, Feb 24, 2015 at 12:33:58AM +0100, Johannes Berg wrote:
> There's no need for the second conditional as the same will be
> done immediately afterwards if there's no station assigned.
>
> Remove the useless conditional, move fallback assignment into
> the else branch and don't try to look up a multicast address
> which cannot be found anyway.
It looks like this breaks ap_vlan_* hwsim test cases. Found by git
bisect on current wireless-testing, confirmed by reverting this on top
of the current master branch.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-27 19:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-23 23:33 [PATCH] mac80211: simplify station assignment in ieee80211_tx_prepare() Johannes Berg
2015-02-27 19:55 ` Jouni Malinen
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).