diff options
-rw-r--r-- | net/mac80211/rx.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 265a032dec49..00ade7feb2e3 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -888,14 +888,16 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx) | |||
888 | */ | 888 | */ |
889 | if (rx->sta && rx->sdata->vif.type == NL80211_IFTYPE_STATION && | 889 | if (rx->sta && rx->sdata->vif.type == NL80211_IFTYPE_STATION && |
890 | ieee80211_is_data_present(hdr->frame_control)) { | 890 | ieee80211_is_data_present(hdr->frame_control)) { |
891 | u16 ethertype; | 891 | unsigned int hdrlen; |
892 | u8 *payload; | 892 | __be16 ethertype; |
893 | 893 | ||
894 | payload = rx->skb->data + | 894 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
895 | ieee80211_hdrlen(hdr->frame_control); | 895 | |
896 | ethertype = (payload[6] << 8) | payload[7]; | 896 | if (rx->skb->len < hdrlen + 8) |
897 | if (cpu_to_be16(ethertype) == | 897 | return RX_DROP_MONITOR; |
898 | rx->sdata->control_port_protocol) | 898 | |
899 | skb_copy_bits(rx->skb, hdrlen + 6, ðertype, 2); | ||
900 | if (ethertype == rx->sdata->control_port_protocol) | ||
899 | return RX_CONTINUE; | 901 | return RX_CONTINUE; |
900 | } | 902 | } |
901 | 903 | ||