summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_tunnel.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-16 01:24:13 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-16 01:24:13 -0700
commit554eb27782d4bb79e0a286a08ecafb81f758058c (patch)
treeb330c16faef8614928e0c260f0f966aeb9afb8a3 /net/ipv6/ip6_tunnel.c
parent2f7f54b725f1a93f0a4daace1a924bee382b33b6 (diff)
downloadtalos-obmc-linux-554eb27782d4bb79e0a286a08ecafb81f758058c.tar.gz
talos-obmc-linux-554eb27782d4bb79e0a286a08ecafb81f758058c.zip
[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.
And no need in some IPPROTO_XXX enabling, since ipv6 code doesn't have any filtering. So, just set proper net and mark device with NETNS_LOCAL. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_tunnel.c')
-rw-r--r--net/ipv6/ip6_tunnel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index d9b272159097..2bda3ba100b1 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -243,6 +243,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
if (dev == NULL)
goto failed;
+ dev_net_set(dev, net);
+
if (strchr(name, '%')) {
if (dev_alloc_name(dev, name) < 0)
goto failed_free;
@@ -1341,6 +1343,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr);
dev->flags |= IFF_NOARP;
dev->addr_len = sizeof(struct in6_addr);
+ dev->features |= NETIF_F_NETNS_LOCAL;
}
OpenPOWER on IntegriCloud