Re: [PATCH net-next] ipv4/fib: send RTM_DELROUTE notify when flush fib

Stephen Hemminger
2023-07-18T15:58:18Z

On Tue, 18 Jul 2023 13:19:06 +0300
Ido Schimmel <idosch@idosch.org> wrote:

> fib_table_flush() isn't only called when an address is deleted, but also
> when an interface is deleted or put down. The lack of notification in
> these cases is deliberate. Commit 7c6bb7d2faaf ("net/ipv6: Add knob to
> skip DELROUTE message on device down") introduced a sysctl to make IPv6
> behave like IPv4 in this regard, but this patch breaks it.
>
> IMO, the number of routes being flushed because a preferred source
> address is deleted is significantly lower compared to interface down /
> deletion, so generating notifications in this case is probably OK. It
> also seems to be consistent with IPv6 given that rt6_remove_prefsrc()
> calls fib6_clean_all() and not fib6_clean_all_skip_notify().

Agree. Imagine the case of 3 million routes and device goes down.
There is a reason IPv4 behaves the way it does.