[Devel] [PATCH RH7/RH8] ipv6 tunnels: enable netdevice register inside container

Vasily Averin vvs at virtuozzo.com
Mon Apr 5 12:15:57 MSK 2021


ipv6 tunnel network devices should have NETIF_F_VIRTUAL feature
to be registered inside containers.

Similar problem for sit wa fixed recently in
https://jira.sw.ru/browse/PSBM-127315
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
  net/ipv6/ip6_gre.c    | 1 +
  net/ipv6/ip6_tunnel.c | 1 +
  2 files changed, 2 insertions(+)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 574369249d8e..b927320690bd 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1097,6 +1097,7 @@ static void ip6gre_tunnel_setup(struct net_device *dev)
  
  	dev->type = ARPHRD_IP6GRE;
  
+	dev->features |= NETIF_F_VIRTUAL;
  	dev->flags |= IFF_NOARP;
  	dev->addr_len = sizeof(struct in6_addr);
  	netif_keep_dst(dev);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 94c892be8820..f79b0e61144c 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1707,6 +1707,7 @@ static void ip6_tnl_dev_setup(struct net_device *dev)
  		dev->mtu-=8;
  	dev->flags |= IFF_NOARP;
  	dev->addr_len = sizeof(struct in6_addr);
+	dev->features |= NETIF_F_VIRTUAL;
  	netif_keep_dst(dev);
  	/* This perm addr will be used as interface identifier by IPv6 */
  	dev->addr_assign_type = NET_ADDR_RANDOM;
-- 
2.25.1



More information about the Devel mailing list