aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>2014-05-14 11:43:07 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-15 15:51:42 -0400
commit8c84296fd2867118944399ab7e9051515a70d60d (patch)
treec258f1be2848e07f75979202bce494acb610cfe0 /net/mac802154
parentc3a6114f31600b94ee10ebf62e4d493b401ade87 (diff)
mac802154: account for all header parts during wpan header creationg
The current WPAN header creation code checks for EMSGSIZE conditions, but does not account for the MIC field that link layer security may add at the end of the frame. Now that we can accurately calculate the maximum payload size of packets, use that to check for EMSGSIZE conditions. Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/wpan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index 1df7a6a57386..cb34064d05f6 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -231,7 +231,7 @@ static int mac802154_header_create(struct sk_buff *skb,
231 skb_reset_mac_header(skb); 231 skb_reset_mac_header(skb);
232 skb->mac_len = hlen; 232 skb->mac_len = hlen;
233 233
234 if (hlen + len + 2 > dev->mtu) 234 if (len > ieee802154_max_payload(&hdr))
235 return -EMSGSIZE; 235 return -EMSGSIZE;
236 236
237 return hlen; 237 return hlen;