Skip to content

Commit

Permalink
mac80211: Fix frame injection using non-AP vif
Browse files Browse the repository at this point in the history
In order for frame injection to work properly for some use cases
(e.g., finding the station entry and keys for encryption), mac80211
needs to find the correct sdata entry. This works when the main vif
is in AP mode, but commit a2c1e3d
broke this particular use case for station main vif. While this type of
injection is quite unusual operation, it has some uses and we should fix
it. Do this by changing the monitor vif sdata selection to allow station
vif to be selected instead of limiting it to just AP vifs. We still need
to skip some iftypes to avoid selecting unsuitable vif for injection.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Nov 29, 2010
1 parent 4604778 commit 7dff312
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,12 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
list) {
if (!ieee80211_sdata_running(tmp_sdata))
continue;
if (tmp_sdata->vif.type != NL80211_IFTYPE_AP)
if (tmp_sdata->vif.type ==
NL80211_IFTYPE_MONITOR ||
tmp_sdata->vif.type ==
NL80211_IFTYPE_AP_VLAN ||
tmp_sdata->vif.type ==
NL80211_IFTYPE_WDS)
continue;
if (compare_ether_addr(tmp_sdata->vif.addr,
hdr->addr2) == 0) {
Expand Down

0 comments on commit 7dff312

Please sign in to comment.