Skip to content

Commit

Permalink
ieee802154: lowpan_header_create check must check daddr
Browse files Browse the repository at this point in the history
Packet sockets may call dev_header_parse with NULL daddr. Make
lowpan_header_ops.create fail.

Fixes: 87a93e4 ("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>
  • Loading branch information
wdebruij authored and davem330 committed Dec 24, 2018
1 parent 7bdca37 commit 40c3ff6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ieee802154/6lowpan/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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?
*/
Expand Down

0 comments on commit 40c3ff6

Please sign in to comment.