Skip to content
Snippets Groups Projects
Commit 8cc27d17 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch '6lowpan'


Alan Ott says:

====================
Alexander Aring suggested that devices desired to be linked to 6lowpan
be checked for actually being of type IEEE802154, since IEEE802154 devices
are all that are supported by 6lowpan at present.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 88ba09df ab2d95df
No related branches found
No related tags found
No related merge requests found
...@@ -1372,6 +1372,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, ...@@ -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])); real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK]));
if (!real_dev) if (!real_dev)
return -ENODEV; return -ENODEV;
if (real_dev->type != ARPHRD_IEEE802154)
return -EINVAL;
lowpan_dev_info(dev)->real_dev = real_dev; lowpan_dev_info(dev)->real_dev = real_dev;
lowpan_dev_info(dev)->fragment_tag = 0; lowpan_dev_info(dev)->fragment_tag = 0;
...@@ -1386,6 +1388,9 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, ...@@ -1386,6 +1388,9 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
entry->ldev = dev; entry->ldev = dev;
/* Set the lowpan harware address to the wpan hardware address. */
memcpy(dev->dev_addr, real_dev->dev_addr, IEEE802154_ADDR_LEN);
mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx);
INIT_LIST_HEAD(&entry->list); INIT_LIST_HEAD(&entry->list);
list_add_tail(&entry->list, &lowpan_devices); list_add_tail(&entry->list, &lowpan_devices);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment