diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-04-16 08:56:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-17 14:17:04 -0400 |
commit | 973ef21a676e55a8e1a100a6e109f0c116ea75e8 (patch) | |
tree | f1cde80fd13225f7fbc18562408459eb8e32fd3c /net/mac80211/rx.c | |
parent | 32998cc96a76cc3f42f66b55fec301377e439c66 (diff) |
mac80211: fix truncated packets in cooked monitor rx
Cooked monitor rx was recently changed to use ieee80211_add_rx_radiotap_header
instead of generating only limited radiotap information.
ieee80211_add_rx_radiotap_header assumes that FCS info is still present if
the hardware supports receiving it, however when cooked monitor rx packets
are processed, FCS info has already been stripped.
Fix this by adding an extra flag indicating FCS presence.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index bcfe8c77c839..d64e285400aa 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -103,7 +103,7 @@ static void | |||
103 | ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, | 103 | ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, |
104 | struct sk_buff *skb, | 104 | struct sk_buff *skb, |
105 | struct ieee80211_rate *rate, | 105 | struct ieee80211_rate *rate, |
106 | int rtap_len) | 106 | int rtap_len, bool has_fcs) |
107 | { | 107 | { |
108 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); | 108 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
109 | struct ieee80211_radiotap_header *rthdr; | 109 | struct ieee80211_radiotap_header *rthdr; |
@@ -134,7 +134,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, | |||
134 | } | 134 | } |
135 | 135 | ||
136 | /* IEEE80211_RADIOTAP_FLAGS */ | 136 | /* IEEE80211_RADIOTAP_FLAGS */ |
137 | if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) | 137 | if (has_fcs && (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)) |
138 | *pos |= IEEE80211_RADIOTAP_F_FCS; | 138 | *pos |= IEEE80211_RADIOTAP_F_FCS; |
139 | if (status->flag & (RX_FLAG_FAILED_FCS_CRC | RX_FLAG_FAILED_PLCP_CRC)) | 139 | if (status->flag & (RX_FLAG_FAILED_FCS_CRC | RX_FLAG_FAILED_PLCP_CRC)) |
140 | *pos |= IEEE80211_RADIOTAP_F_BADFCS; | 140 | *pos |= IEEE80211_RADIOTAP_F_BADFCS; |
@@ -294,7 +294,8 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb, | |||
294 | } | 294 | } |
295 | 295 | ||
296 | /* prepend radiotap information */ | 296 | /* prepend radiotap information */ |
297 | ieee80211_add_rx_radiotap_header(local, skb, rate, needed_headroom); | 297 | ieee80211_add_rx_radiotap_header(local, skb, rate, needed_headroom, |
298 | true); | ||
298 | 299 | ||
299 | skb_reset_mac_header(skb); | 300 | skb_reset_mac_header(skb); |
300 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 301 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -2571,7 +2572,8 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, | |||
2571 | goto out_free_skb; | 2572 | goto out_free_skb; |
2572 | 2573 | ||
2573 | /* prepend radiotap information */ | 2574 | /* prepend radiotap information */ |
2574 | ieee80211_add_rx_radiotap_header(local, skb, rate, needed_headroom); | 2575 | ieee80211_add_rx_radiotap_header(local, skb, rate, needed_headroom, |
2576 | false); | ||
2575 | 2577 | ||
2576 | skb_set_mac_header(skb, 0); | 2578 | skb_set_mac_header(skb, 0); |
2577 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 2579 | skb->ip_summed = CHECKSUM_UNNECESSARY; |