mbox series

[net,0/2] net: ipv4: fix nexthop route delete warning

Message ID 20220331154615.108214-1-razor@blackwall.org (mailing list archive)
Headers show
Series net: ipv4: fix nexthop route delete warning | expand

Message

Nikolay Aleksandrov March 31, 2022, 3:46 p.m. UTC
Hi,
The first patch fixes a warning that can be triggered by deleting a
nexthop route and specifying a device (more info in its commit msg).
And the second patch adds a selftest for that case.

For the fix the alternative would be to do matching on the nexthop's
attributes but I think we shouldn't since it's old-style route deletion
and nexthops are managed through a different interface, so I chose to
don't do any matching if the fib_info is a nexthop route and the user
specified old-style attributes to match on (e.g. device in this case)
which preserves the current behaviour and avoids the warning.

Thanks,
 Nik

Nikolay Aleksandrov (2):
  net: ipv4: fix route with nexthop object delete warning
  selftests: net: add delete nexthop route warning test

 net/ipv4/fib_semantics.c                    |  7 ++++++-
 tools/testing/selftests/net/fib_nexthops.sh | 13 +++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

Comments

Nikolay Aleksandrov April 1, 2022, 7:18 a.m. UTC | #1
On 31/03/2022 18:46, Nikolay Aleksandrov wrote:
> Hi,
> The first patch fixes a warning that can be triggered by deleting a
> nexthop route and specifying a device (more info in its commit msg).
> And the second patch adds a selftest for that case.
> 
> For the fix the alternative would be to do matching on the nexthop's
> attributes but I think we shouldn't since it's old-style route deletion
> and nexthops are managed through a different interface, so I chose to
> don't do any matching if the fib_info is a nexthop route and the user
> specified old-style attributes to match on (e.g. device in this case)
> which preserves the current behaviour and avoids the warning.
> 
> Thanks,
>  Nik
> 
> Nikolay Aleksandrov (2):
>   net: ipv4: fix route with nexthop object delete warning
>   selftests: net: add delete nexthop route warning test
> 
>  net/ipv4/fib_semantics.c                    |  7 ++++++-
>  tools/testing/selftests/net/fib_nexthops.sh | 13 +++++++++++++
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 

I'll send v2 with an updated comment in the selftest and added tags.

Thanks,
 Nik