Skip to content

Commit

Permalink
[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Apr 16, 2008
1 parent 2f7f54b commit 554eb27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}


Expand Down

0 comments on commit 554eb27

Please sign in to comment.