提交 554eb277 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[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: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2f7f54b7
...@@ -243,6 +243,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p) ...@@ -243,6 +243,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
if (dev == NULL) if (dev == NULL)
goto failed; goto failed;
dev_net_set(dev, net);
if (strchr(name, '%')) { if (strchr(name, '%')) {
if (dev_alloc_name(dev, name) < 0) if (dev_alloc_name(dev, name) < 0)
goto failed_free; goto failed_free;
...@@ -1341,6 +1343,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev) ...@@ -1341,6 +1343,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr);
dev->flags |= IFF_NOARP; dev->flags |= IFF_NOARP;
dev->addr_len = sizeof(struct in6_addr); dev->addr_len = sizeof(struct in6_addr);
dev->features |= NETIF_F_NETNS_LOCAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册