From: Lance Richardson <lrich...@redhat.com> Date: Mon, 8 Aug 2016 18:22:45 -0400
> @@ -392,6 +393,17 @@ static int vti_tunnel_init(struct net_device *dev) > return ip_tunnel_init(dev); > } > > +static void vti_tunnel_uninit(struct net_device *dev) > +{ > + struct ip_tunnel *tunnel = netdev_priv(dev); > + struct net *net = tunnel->net; > + > + ip_tunnel_uninit(dev); > + > + if (!net_eq(net, dev_net(dev))) > + xfrm_garbage_collect(net); > +} Like the normal netns, this netns should be expunged from the flow cache on interface down, not uninit. So like the existing facilities do, you should add a NETDEV_DOWN notifier that flushes tunnel->net if necessary.