aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/6lowpan/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee802154/6lowpan/core.c')
-rw-r--r--net/ieee802154/6lowpan/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 055fbb71ba6f..dfd3c6007f60 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -126,6 +126,7 @@ static void lowpan_setup(struct net_device *dev)
126 dev->header_ops = &lowpan_header_ops; 126 dev->header_ops = &lowpan_header_ops;
127 dev->ml_priv = &lowpan_mlme; 127 dev->ml_priv = &lowpan_mlme;
128 dev->destructor = free_netdev; 128 dev->destructor = free_netdev;
129 dev->features |= NETIF_F_NETNS_LOCAL;
129} 130}
130 131
131static int lowpan_validate(struct nlattr *tb[], struct nlattr *data[]) 132static int lowpan_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -148,10 +149,11 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
148 149
149 pr_debug("adding new link\n"); 150 pr_debug("adding new link\n");
150 151
151 if (!tb[IFLA_LINK]) 152 if (!tb[IFLA_LINK] ||
153 !net_eq(dev_net(dev), &init_net))
152 return -EINVAL; 154 return -EINVAL;
153 /* find and hold real wpan device */ 155 /* find and hold real wpan device */
154 real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); 156 real_dev = dev_get_by_index(dev_net(dev), nla_get_u32(tb[IFLA_LINK]));
155 if (!real_dev) 157 if (!real_dev)
156 return -ENODEV; 158 return -ENODEV;
157 if (real_dev->type != ARPHRD_IEEE802154) { 159 if (real_dev->type != ARPHRD_IEEE802154) {