ieee802154: lowpan_header_create check must check daddr
authorWillem de Bruijn <willemb@google.com>
Sun, 23 Dec 2018 17:52:18 +0000 (12:52 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Dec 2018 22:31:22 +0000 (14:31 -0800)
Packet sockets may call dev_header_parse with NULL daddr. Make
lowpan_header_ops.create fail.

Fixes: 87a93e4eceb4 ("ieee802154: change needed headroom/tailroom")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Alexander Aring <aring@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan/tx.c

index ca53efa17be15b78db9e00372b33a9ef0911b47f..8bec827081cd9980c778025caad4a0499bd923c2 100644 (file)
@@ -48,6 +48,9 @@ int lowpan_header_create(struct sk_buff *skb, struct net_device *ldev,
        const struct ipv6hdr *hdr = ipv6_hdr(skb);
        struct neighbour *n;
 
+       if (!daddr)
+               return -EINVAL;
+
        /* TODO:
         * if this package isn't ipv6 one, where should it be routed?
         */