aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r--net/wireless/util.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 343f13c1d31d..5b6c1df72f31 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -311,23 +311,21 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb)
311} 311}
312EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb); 312EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb);
313 313
314static int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr) 314unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr)
315{ 315{
316 int ae = meshhdr->flags & MESH_FLAGS_AE; 316 int ae = meshhdr->flags & MESH_FLAGS_AE;
317 /* 7.1.3.5a.2 */ 317 /* 802.11-2012, 8.2.4.7.3 */
318 switch (ae) { 318 switch (ae) {
319 default:
319 case 0: 320 case 0:
320 return 6; 321 return 6;
321 case MESH_FLAGS_AE_A4: 322 case MESH_FLAGS_AE_A4:
322 return 12; 323 return 12;
323 case MESH_FLAGS_AE_A5_A6: 324 case MESH_FLAGS_AE_A5_A6:
324 return 18; 325 return 18;
325 case (MESH_FLAGS_AE_A4 | MESH_FLAGS_AE_A5_A6):
326 return 24;
327 default:
328 return 6;
329 } 326 }
330} 327}
328EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
331 329
332int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr, 330int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
333 enum nl80211_iftype iftype) 331 enum nl80211_iftype iftype)
@@ -375,6 +373,8 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
375 /* make sure meshdr->flags is on the linear part */ 373 /* make sure meshdr->flags is on the linear part */
376 if (!pskb_may_pull(skb, hdrlen + 1)) 374 if (!pskb_may_pull(skb, hdrlen + 1))
377 return -1; 375 return -1;
376 if (meshdr->flags & MESH_FLAGS_AE_A4)
377 return -1;
378 if (meshdr->flags & MESH_FLAGS_AE_A5_A6) { 378 if (meshdr->flags & MESH_FLAGS_AE_A5_A6) {
379 skb_copy_bits(skb, hdrlen + 379 skb_copy_bits(skb, hdrlen +
380 offsetof(struct ieee80211s_hdr, eaddr1), 380 offsetof(struct ieee80211s_hdr, eaddr1),
@@ -399,6 +399,8 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
399 /* make sure meshdr->flags is on the linear part */ 399 /* make sure meshdr->flags is on the linear part */
400 if (!pskb_may_pull(skb, hdrlen + 1)) 400 if (!pskb_may_pull(skb, hdrlen + 1))
401 return -1; 401 return -1;
402 if (meshdr->flags & MESH_FLAGS_AE_A5_A6)
403 return -1;
402 if (meshdr->flags & MESH_FLAGS_AE_A4) 404 if (meshdr->flags & MESH_FLAGS_AE_A4)
403 skb_copy_bits(skb, hdrlen + 405 skb_copy_bits(skb, hdrlen +
404 offsetof(struct ieee80211s_hdr, eaddr1), 406 offsetof(struct ieee80211s_hdr, eaddr1),