summaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/wpan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index b6142666286..80cbee1a2f5 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -150,6 +150,9 @@ static int mac802154_header_create(struct sk_buff *skb,
skb_reset_mac_header(skb);
skb->mac_len = hlen;
+ if (hlen + len + 2 > dev->mtu)
+ return -EMSGSIZE;
+
return hlen;
}