diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index d4edd20dab5fbadbeb7ab33fe85a03f780859f81..606039442a590ee400a5d55c5672a917dbc8352d 100644 --- a/net/ieee802154/6lowpan_rtnl.c +++ b/net/ieee802154/6lowpan_rtnl.c @@ -141,7 +141,7 @@ static int lowpan_header_create(struct sk_buff *skb, } return dev_hard_header(skb, lowpan_dev_info(dev)->real_dev, - type, (void *)&da, (void *)&sa, skb->len); + type, (void *)&da, (void *)&sa, 0); } static int lowpan_give_skb_to_devices(struct sk_buff *skb, diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 55f2dc45a7dc72d7dcc74c986332dbdf8bc71d05..4c47154041b0bc5983506f8cf2d2586695ca438a 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c @@ -233,7 +233,7 @@ static int dgram_sendmsg(struct kiocb *iocb, struct sock *sk, if (size > mtu) { pr_debug("size = %Zu, mtu = %u\n", size, mtu); - err = -EINVAL; + err = -EMSGSIZE; goto out_dev; } diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c index b61426662867ff9ba552619e066c1c8141dae0b8..80cbee1a2f567aaf3521419bc13e9beab168bb59 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; }