ieee802154: add proper length checks to header creations

Have mac802154 header_ops.create fail with -EMSGSIZE if the length
passed will be too large to fit a frame. Since 6lowpan will ensure that
no packet payload will be too large, pass a length of 0 there. 802.15.4
dgram sockets will also return -EMSGSIZE on payloads larger than the
device MTU instead of -EINVAL.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/mac802154/wpan.c b/net/mac802154/wpan.c
index b614266..80cbee1 100644
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -150,6 +150,9 @@
 	skb_reset_mac_header(skb);
 	skb->mac_len = hlen;
 
+	if (hlen + len + 2 > dev->mtu)
+		return -EMSGSIZE;
+
 	return hlen;
 }