Explorar o código

mac802154: set phy net namespace for new ifaces

This patch sets the net namespace when creating SoftMAC interfaces. This
is important if the namespace at phy layer was switched before.
Currently we losing interfaces in some namespace and it's not possible
to recover that.

Signed-off-by: Alexander Aring <aar@pengutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Alexander Aring %!s(int64=9) %!d(string=hai) anos
pai
achega
abbcc341ad
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      net/mac802154/iface.c

+ 1 - 0
net/mac802154/iface.c

@@ -663,6 +663,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
 
 
 	/* TODO check this */
 	/* TODO check this */
 	SET_NETDEV_DEV(ndev, &local->phy->dev);
 	SET_NETDEV_DEV(ndev, &local->phy->dev);
+	dev_net_set(ndev, wpan_phy_net(local->hw.phy));
 	sdata = netdev_priv(ndev);
 	sdata = netdev_priv(ndev);
 	ndev->ieee802154_ptr = &sdata->wpan_dev;
 	ndev->ieee802154_ptr = &sdata->wpan_dev;
 	memcpy(sdata->name, ndev->name, IFNAMSIZ);
 	memcpy(sdata->name, ndev->name, IFNAMSIZ);