diff mbox series

[net-next,v6,06/11] ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del()

Message ID 18a49a3a5d0274df90f059f37d3601abd0bac879.1560987611.git.sbrivio@redhat.com
State Changes Requested
Delegated to: David Miller
Headers show
Series Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions | expand

Commit Message

Stefano Brivio June 19, 2019, 11:59 p.m. UTC
If fc_nh_id isn't set, we shouldn't try to match against it. This
actually matters just for the RTF_CACHE case below (where this is
already handled): if iproute2 gets a route exception and tries to
delete it, it won't reference its fc_nh_id, even if a nexthop
object might be associated to the originating route.

Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
v6: New patch

 net/ipv6/route.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Ahern June 20, 2019, 2:16 p.m. UTC | #1
On 6/19/19 5:59 PM, Stefano Brivio wrote:
> If fc_nh_id isn't set, we shouldn't try to match against it. This
> actually matters just for the RTF_CACHE case below (where this is
> already handled): if iproute2 gets a route exception and tries to
> delete it, it won't reference its fc_nh_id, even if a nexthop
> object might be associated to the originating route.
> 
> Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
> v6: New patch
> 
>  net/ipv6/route.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Thanks for catching that.

Reviewed-by: David Ahern <dsahern@gmail.com>
Stefano Brivio June 20, 2019, 7:01 p.m. UTC | #2
On Thu, 20 Jun 2019 08:16:28 -0600
David Ahern <dsahern@gmail.com> wrote:

> On 6/19/19 5:59 PM, Stefano Brivio wrote:
> > If fc_nh_id isn't set, we shouldn't try to match against it. This
> > actually matters just for the RTF_CACHE case below (where this is
> > already handled): if iproute2 gets a route exception and tries to
> > delete it, it won't reference its fc_nh_id, even if a nexthop
> > object might be associated to the originating route.
> > 
> > Fixes: 5b98324ebe29 ("ipv6: Allow routes to use nexthop objects")
> > Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> > ---
> > v6: New patch
> > 
> >  net/ipv6/route.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >   
> 
> Thanks for catching that.

Your recent addition to pmtu.sh did it :)
diff mbox series

Patch

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c4d285fe0adc..86859023cd01 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3827,7 +3827,8 @@  static int ip6_route_del(struct fib6_config *cfg,
 		for_each_fib6_node_rt_rcu(fn) {
 			struct fib6_nh *nh;
 
-			if (rt->nh && rt->nh->id != cfg->fc_nh_id)
+			if (rt->nh && cfg->fc_nh_id &&
+			    rt->nh->id != cfg->fc_nh_id)
 				continue;
 
 			if (cfg->fc_flags & RTF_CACHE) {