From: Alexander Aring Date: Sun, 24 Jul 2016 14:12:24 +0000 (+0200) Subject: mac802154: set phy net namespace for new ifaces X-Git-Tag: v4.9-rc1~127^2~128^2~54 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=abbcc341adb16f68915cae7ef9a10e0d7b57e3c0;p=karo-tx-linux.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 7079cd32a7ad..06019dba4b10 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -663,6 +663,7 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name, /* TODO check this */ SET_NETDEV_DEV(ndev, &local->phy->dev); + dev_net_set(ndev, wpan_phy_net(local->hw.phy)); sdata = netdev_priv(ndev); ndev->ieee802154_ptr = &sdata->wpan_dev; memcpy(sdata->name, ndev->name, IFNAMSIZ);