Skip to content

Commit

Permalink
mac802154: account for all header parts during wpan header creationg
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phoebe Buckheister authored and David S. Miller committed May 15, 2014
1 parent c3a6114 commit 8c84296
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac802154/wpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static int mac802154_header_create(struct sk_buff *skb,
skb_reset_mac_header(skb);
skb->mac_len = hlen;

if (hlen + len + 2 > dev->mtu)
if (len > ieee802154_max_payload(&hdr))
return -EMSGSIZE;

return hlen;
Expand Down

0 comments on commit 8c84296

Please sign in to comment.