diff mbox

[bluetooth-next,1/2] mac802154: set phy net namespace for new ifaces

Message ID 20160724141225.17591-1-aar@pengutronix.de (mailing list archive)
State Accepted
Headers show

Commit Message

Alexander Aring July 24, 2016, 2:12 p.m. UTC
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>
---
 net/mac802154/iface.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Marcel Holtmann July 24, 2016, 4:42 p.m. UTC | #1
Hi Alex,

> 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>
> ---
> net/mac802154/iface.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 7079cd3..06019db 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);