aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 88f262baaa5e..5227c16f113e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -218,23 +218,11 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb)
218} 218}
219EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb); 219EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb);
220 220
221int ieee80211_is_eapol(const struct sk_buff *skb) 221int ieee80211_is_eapol(const struct sk_buff *skb, int hdrlen)
222{ 222{
223 const struct ieee80211_hdr *hdr;
224 u16 fc;
225 int hdrlen;
226
227 if (unlikely(skb->len < 10)) 223 if (unlikely(skb->len < 10))
228 return 0; 224 return 0;
229 225
230 hdr = (const struct ieee80211_hdr *) skb->data;
231 fc = le16_to_cpu(hdr->frame_control);
232
233 if (unlikely(!WLAN_FC_DATA_PRESENT(fc)))
234 return 0;
235
236 hdrlen = ieee80211_get_hdrlen(fc);
237
238 if (unlikely(skb->len >= hdrlen + sizeof(eapol_header) && 226 if (unlikely(skb->len >= hdrlen + sizeof(eapol_header) &&
239 memcmp(skb->data + hdrlen, eapol_header, 227 memcmp(skb->data + hdrlen, eapol_header,
240 sizeof(eapol_header)) == 0)) 228 sizeof(eapol_header)) == 0))