diff options
author | Alan Ott <alan@signal11.us> | 2013-10-05 23:15:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-08 15:28:37 -0400 |
commit | 7adac1ec8198e9f5c802918e58a967b92db4a66f (patch) | |
tree | 155a6bc0a7584062298606fd407028a8466492e9 /net/ieee802154 | |
parent | 88ba09df236c618b5466d35a0165df0dc865eac5 (diff) |
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 <alan@signal11.us>
Suggested-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r-- | net/ieee802154/6lowpan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c index c85e71e0c7ff..8f56b2b63bfb 100644 --- a/net/ieee802154/6lowpan.c +++ b/net/ieee802154/6lowpan.c @@ -1372,6 +1372,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); if (!real_dev) return -ENODEV; + if (real_dev->type != ARPHRD_IEEE802154) + return -EINVAL; lowpan_dev_info(dev)->real_dev = real_dev; lowpan_dev_info(dev)->fragment_tag = 0; |