Commit 0a826406d4adf0c4b7cd47f116cb8e8ef65b92a3

Authored by Pavel Emelyanov
Committed by David S. Miller
1 parent b99f0152e5

[IPIP]: Allow to create IPIP tunnels in net namespaces.

Set the proper net before calling register_netdev and disable
the tunnel device netns changing.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -239,6 +239,8 @@
239 239 if (dev == NULL)
240 240 return NULL;
241 241  
  242 + dev_net_set(dev, net);
  243 +
242 244 if (strchr(name, '%')) {
243 245 if (dev_alloc_name(dev, name) < 0)
244 246 goto failed_free;
... ... @@ -839,6 +841,7 @@
839 841 dev->flags = IFF_NOARP;
840 842 dev->iflink = 0;
841 843 dev->addr_len = 4;
  844 + dev->features |= NETIF_F_NETNS_LOCAL;
842 845 }
843 846  
844 847 static int ipip_tunnel_init(struct net_device *dev)