Skip to content

Commit 3401bfb

Browse files
sbrivio-rhdavem330
authored andcommitted
ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del()
If fc_nh_id isn't set, we shouldn't try to match against it. This actually matters just for the RTF_CACHE below (where this case is already handled): if iproute2 gets a route exception and tries to delete it, it won't reference it by fc_nh_id, even if a nexthop object might be associated to the originating route. Fixes: 5b98324 ("ipv6: Allow routes to use nexthop objects") Signed-off-by: Stefano Brivio <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ef11209 commit 3401bfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv6/route.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3840,7 +3840,8 @@ static int ip6_route_del(struct fib6_config *cfg,
38403840
for_each_fib6_node_rt_rcu(fn) {
38413841
struct fib6_nh *nh;
38423842

3843-
if (rt->nh && rt->nh->id != cfg->fc_nh_id)
3843+
if (rt->nh && cfg->fc_nh_id &&
3844+
rt->nh->id != cfg->fc_nh_id)
38443845
continue;
38453846

38463847
if (cfg->fc_flags & RTF_CACHE) {

0 commit comments

Comments
 (0)