6lowpan: Sync default hardware address of lowpan links to their wpan
authorAlan Ott <alan@signal11.us>
Sun, 6 Oct 2013 03:15:19 +0000 (23:15 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Oct 2013 19:28:37 +0000 (15:28 -0400)
When a lowpan link to a wpan device is created, set the hardware address
of the lowpan link to that of the wpan device.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan.c

index 8f56b2b63bfb35bdb9060f0d101221be21580fc0..ff41b4d60d302e18a1ebcf1bdfc950970fdd3aae 100644 (file)
@@ -1388,6 +1388,9 @@ static int lowpan_newlink(struct net *src_net, struct net_device *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);
        INIT_LIST_HEAD(&entry->list);
        list_add_tail(&entry->list, &lowpan_devices);