diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-04-16 04:06:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-16 04:06:18 -0400 |
commit | 0a826406d4adf0c4b7cd47f116cb8e8ef65b92a3 (patch) | |
tree | 9da0f22c3dfc2d5b6bd672f5e14d816decba2540 /net | |
parent | b99f0152e5f96dde31d2b9060b4f1029abc11078 (diff) |
[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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ipip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 1de39e1dc432..149111f08e8d 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -239,6 +239,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct net *net, | |||
239 | if (dev == NULL) | 239 | if (dev == NULL) |
240 | return NULL; | 240 | return NULL; |
241 | 241 | ||
242 | dev_net_set(dev, net); | ||
243 | |||
242 | if (strchr(name, '%')) { | 244 | if (strchr(name, '%')) { |
243 | if (dev_alloc_name(dev, name) < 0) | 245 | if (dev_alloc_name(dev, name) < 0) |
244 | goto failed_free; | 246 | goto failed_free; |
@@ -839,6 +841,7 @@ static void ipip_tunnel_setup(struct net_device *dev) | |||
839 | dev->flags = IFF_NOARP; | 841 | dev->flags = IFF_NOARP; |
840 | dev->iflink = 0; | 842 | dev->iflink = 0; |
841 | dev->addr_len = 4; | 843 | dev->addr_len = 4; |
844 | dev->features |= NETIF_F_NETNS_LOCAL; | ||
842 | } | 845 | } |
843 | 846 | ||
844 | static int ipip_tunnel_init(struct net_device *dev) | 847 | static int ipip_tunnel_init(struct net_device *dev) |