Re: [PATCHv2 net-next 2/2] ipv4/fib: send notify when delete source address routes

Hangbin Liu
2023-08-15T12:55:38Z

On Thu, Aug 10, 2023 at 06:08:28PM +0300, Ido Schimmel wrote:
> On Wed, Aug 09, 2023 at 10:02:34PM +0800, Hangbin Liu wrote:
> > After deleting an interface address in fib_del_ifaddr(), the function
> > scans the fib_info list for stray entries and calls fib_flush() and
> > fib_table_flush(). Then the stray entries will be deleted silently and no
> > RTM_DELROUTE notification will be sent.
> >
> > This lack of notification can make routing daemons like NetworkManager,
> > miss the routing changes. e.g.
>
> [...]
>
> > To fix this issue, let's add a new bit in "struct fib_info" to track the
> > deleted prefer source address routes, and only send notify for them.
>
> In the other thread Thomas mentioned that NM already requests a route
> dump following address deletion [1]. If so, can Thomas or you please
> explain how this patch is going to help NM? Is the intention to optimize
> things and avoid the dump request (which can only work on new kernels)?
>
> [1] https://lore.kernel.org/netdev/07fcfd504148b3c721fda716ad0a549662708407.camel@redhat.com/

In my understanding, After deleting an address, deal with the delete notify is
more efficient to maintain the route cache than dump all the routes.

Hi Thomas ,do you have any comments?

Thanks
Hangbin