mac802154: use dev_addr_set() - manual
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
659f4e02f1
commit
08bb7516e5
@ -157,7 +157,7 @@ static int lowpan_newlink(struct net *src_net, struct net_device *ldev,
|
|||||||
|
|
||||||
lowpan_802154_dev(ldev)->wdev = wdev;
|
lowpan_802154_dev(ldev)->wdev = wdev;
|
||||||
/* Set the lowpan hardware address to the wpan hardware address. */
|
/* Set the lowpan hardware address to the wpan hardware address. */
|
||||||
memcpy(ldev->dev_addr, wdev->dev_addr, IEEE802154_ADDR_LEN);
|
__dev_addr_set(ldev, wdev->dev_addr, IEEE802154_ADDR_LEN);
|
||||||
/* We need headroom for possible wpan_dev_hard_header call and tailroom
|
/* We need headroom for possible wpan_dev_hard_header call and tailroom
|
||||||
* for encryption/fcs handling. The lowpan interface will replace
|
* for encryption/fcs handling. The lowpan interface will replace
|
||||||
* the IPv6 header with 6LoWPAN header. At worst case the 6LoWPAN
|
* the IPv6 header with 6LoWPAN header. At worst case the 6LoWPAN
|
||||||
|
@ -136,8 +136,7 @@ static int mac802154_wpan_mac_addr(struct net_device *dev, void *p)
|
|||||||
* wpan mac has been changed
|
* wpan mac has been changed
|
||||||
*/
|
*/
|
||||||
if (sdata->wpan_dev.lowpan_dev)
|
if (sdata->wpan_dev.lowpan_dev)
|
||||||
memcpy(sdata->wpan_dev.lowpan_dev->dev_addr, dev->dev_addr,
|
dev_addr_set(sdata->wpan_dev.lowpan_dev, dev->dev_addr);
|
||||||
dev->addr_len);
|
|
||||||
|
|
||||||
return mac802154_wpan_update_llsec(dev);
|
return mac802154_wpan_update_llsec(dev);
|
||||||
}
|
}
|
||||||
@ -615,6 +614,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
|
|||||||
unsigned char name_assign_type, enum nl802154_iftype type,
|
unsigned char name_assign_type, enum nl802154_iftype type,
|
||||||
__le64 extended_addr)
|
__le64 extended_addr)
|
||||||
{
|
{
|
||||||
|
u8 addr[IEEE802154_EXTENDED_ADDR_LEN];
|
||||||
struct net_device *ndev = NULL;
|
struct net_device *ndev = NULL;
|
||||||
struct ieee802154_sub_if_data *sdata = NULL;
|
struct ieee802154_sub_if_data *sdata = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
@ -638,11 +638,12 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case NL802154_IFTYPE_NODE:
|
case NL802154_IFTYPE_NODE:
|
||||||
ndev->type = ARPHRD_IEEE802154;
|
ndev->type = ARPHRD_IEEE802154;
|
||||||
if (ieee802154_is_valid_extended_unicast_addr(extended_addr))
|
if (ieee802154_is_valid_extended_unicast_addr(extended_addr)) {
|
||||||
ieee802154_le64_to_be64(ndev->dev_addr, &extended_addr);
|
ieee802154_le64_to_be64(addr, &extended_addr);
|
||||||
else
|
dev_addr_set(ndev, addr);
|
||||||
memcpy(ndev->dev_addr, ndev->perm_addr,
|
} else {
|
||||||
IEEE802154_EXTENDED_ADDR_LEN);
|
dev_addr_set(ndev, ndev->perm_addr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case NL802154_IFTYPE_MONITOR:
|
case NL802154_IFTYPE_MONITOR:
|
||||||
ndev->type = ARPHRD_IEEE802154_MONITOR;
|
ndev->type = ARPHRD_IEEE802154_MONITOR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user