[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 08 Aug 2016 15:35:22 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: lrichard@...hat.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net] vti: flush x-netns xfrm cache when vti interface
is removed
From: Lance Richardson <lrichard@...hat.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.
Powered by blists - more mailing lists