diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-11-04 06:18:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-09 16:13:53 -0500 |
commit | e7f4a940bb5eecd07cf0039e7d9201badc332ae0 (patch) | |
tree | 49ae5164a9f2f247a6c33d24f27033e1db2f5ba5 /net/mac80211/rx.c | |
parent | b92ab5d86dafc2b3733c5fdd5def40c8fe7ea7c9 (diff) |
mac80211: send unexpected 4addr event
Implement the cfg80211 notification but only send
one event per associated station to avoid having
tons of events if the station thinks it should be
allowed to use 4addr frames but it isn't.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 2ed882f8a9f8..5f6751a07405 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -1342,15 +1342,20 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) | |||
1342 | 1342 | ||
1343 | /* | 1343 | /* |
1344 | * If we receive a 4-addr nullfunc frame from a STA | 1344 | * If we receive a 4-addr nullfunc frame from a STA |
1345 | * that was not moved to a 4-addr STA vlan yet, drop | 1345 | * that was not moved to a 4-addr STA vlan yet send |
1346 | * the frame to the monitor interface, to make sure | 1346 | * the event to userspace and for older hostapd drop |
1347 | * that hostapd sees it | 1347 | * the frame to the monitor interface. |
1348 | */ | 1348 | */ |
1349 | if (ieee80211_has_a4(hdr->frame_control) && | 1349 | if (ieee80211_has_a4(hdr->frame_control) && |
1350 | (rx->sdata->vif.type == NL80211_IFTYPE_AP || | 1350 | (rx->sdata->vif.type == NL80211_IFTYPE_AP || |
1351 | (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && | 1351 | (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && |
1352 | !rx->sdata->u.vlan.sta))) | 1352 | !rx->sdata->u.vlan.sta))) { |
1353 | if (!test_and_set_sta_flag(sta, WLAN_STA_4ADDR_EVENT)) | ||
1354 | cfg80211_rx_unexpected_4addr_frame( | ||
1355 | rx->sdata->dev, sta->sta.addr, | ||
1356 | GFP_ATOMIC); | ||
1353 | return RX_DROP_MONITOR; | 1357 | return RX_DROP_MONITOR; |
1358 | } | ||
1354 | /* | 1359 | /* |
1355 | * Update counter and free packet here to avoid | 1360 | * Update counter and free packet here to avoid |
1356 | * counting this as a dropped packed. | 1361 | * counting this as a dropped packed. |
@@ -2028,12 +2033,17 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx) | |||
2028 | return RX_DROP_MONITOR; | 2033 | return RX_DROP_MONITOR; |
2029 | 2034 | ||
2030 | /* | 2035 | /* |
2031 | * Allow the cooked monitor interface of an AP to see 4-addr frames so | 2036 | * Send unexpected-4addr-frame event to hostapd. For older versions, |
2032 | * that a 4-addr station can be detected and moved into a separate VLAN | 2037 | * also drop the frame to cooked monitor interfaces. |
2033 | */ | 2038 | */ |
2034 | if (ieee80211_has_a4(hdr->frame_control) && | 2039 | if (ieee80211_has_a4(hdr->frame_control) && |
2035 | sdata->vif.type == NL80211_IFTYPE_AP) | 2040 | sdata->vif.type == NL80211_IFTYPE_AP) { |
2041 | if (rx->sta && | ||
2042 | !test_and_set_sta_flag(rx->sta, WLAN_STA_4ADDR_EVENT)) | ||
2043 | cfg80211_rx_unexpected_4addr_frame( | ||
2044 | rx->sdata->dev, rx->sta->sta.addr, GFP_ATOMIC); | ||
2036 | return RX_DROP_MONITOR; | 2045 | return RX_DROP_MONITOR; |
2046 | } | ||
2037 | 2047 | ||
2038 | err = __ieee80211_data_to_8023(rx, &port_control); | 2048 | err = __ieee80211_data_to_8023(rx, &port_control); |
2039 | if (unlikely(err)) | 2049 | if (unlikely(err)) |