Skip to content

Commit 7adac1e

Browse files
signal11davem330
authored andcommitted
6lowpan: Only make 6lowpan links to IEEE802154 devices
Refuse to create 6lowpan links if the actual hardware interface is of any type other than ARPHRD_IEEE802154. Signed-off-by: Alan Ott <[email protected]> Suggested-by: Alexander Aring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 88ba09d commit 7adac1e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ieee802154/6lowpan.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
13721372
real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
13731373
if (!real_dev)
13741374
return -ENODEV;
1375+
if (real_dev->type != ARPHRD_IEEE802154)
1376+
return -EINVAL;
13751377

13761378
lowpan_dev_info(dev)->real_dev = real_dev;
13771379
lowpan_dev_info(dev)->fragment_tag = 0;

0 commit comments

Comments
 (0)