OSDN Git Service

mac80211: don't look up destination station twice
authorJohannes Berg <johannes.berg@intel.com>
Fri, 20 Mar 2015 12:29:29 +0000 (13:29 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 20 Mar 2015 15:27:34 +0000 (16:27 +0100)
commit5041006c42537cce1d3619521f50c29b3bf0a633
tree480a880dc5e7884cd4ff03052e14e39b92215af9
parente8f4fb7c7c6b25dc0495f1fd43b03444f0a5c6e3
mac80211: don't look up destination station twice

There's no need to look up the destination station twice while
building the 802.11 header for a given frame if the frame will
actually be transmitted to the station we initially looked up.

This happens for 4-addr VLAN interfaces and TDLS connections, which
both directly send the frame to the station they looked up, though
in the case of TDLS some station conditions need to be checked.

To avoid that, add a variable indicating that we've looked up the
station that the frame is going to be transmitted to, and avoid the
lookup/flag checking if it already has been done.

In the TDLS case, also move the authorized/wme_sta flag assignment
to the correct place, i.e. only when that station is really used.
Before this change, the new lookup should always have succeeded so
that the potentially erroneous data would be overwritten.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/tx.c