mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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>
This commit is contained in:
parent
c3a6114f31
commit
8c84296fd2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user