Skip to contentSkip to conversation

ipv6/route: return if there is no fib_nh_gw_family

PATCH In review Hangbin Liu 3 participants 3 messages Nov 20, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6/route: return if there is no fib_nh_gw_family

Previously we will return directly if (!rt || !rt->fib6_nh.fib_nh_gw_family) in function rt6_probe(), but after commit cc3a86c802f0
("ipv6: Change rt6_probe to take a fib6_nh"), the logic changed to return if there is fib_nh_gw_family.

Fixes cc3a86c802f0 ("ipv6: Change rt6_probe to take a fib6_nh")
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
index e60bf8e7dd1a..3f83ea851ebf 100644
@@ -634,7 +634,7 @@ static void rt6_probe(struct fib6_nh *fib6_nh)
 	 * Router Reachability Probe MUST be rate-limited
 	 * to no more than one per minute.
 	 */
-	if (fib6_nh->fib_nh_gw_family)
+	if (!fib6_nh->fib_nh_gw_family)
 		return;
 
 	nh_gw = &fib6_nh->fib_nh_gw6;
Signature · 1 line
2.19.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Hangbin Liu

Previously we will return directly if (!rt || !rt->fib6_nh.fib_nh_gw_family) in function rt6_probe(), but after commit cc3a86c802f0
("ipv6: Change rt6_probe to take a fib6_nh"), the logic changed to return if there is fib_nh_gw_family.

Fixes cc3a86c802f0 ("ipv6: Change rt6_probe to take a fib6_nh")
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +0 -0
index e60bf8e7dd1a..3f83ea851ebf 100644

net/ipv6/route.c static void rt6_probe(struct fib6_nh *fib6_nh) · line 640

Quoted 8 lines
net/ipv6/route.c +1 -1
@@ -634,7 +634,7 @@ static void rt6_probe(struct fib6_nh *fib6_nh)
 	 * Router Reachability Probe MUST be rate-limited
 	 * to no more than one per minute.
 	 */
-	if (fib6_nh->fib_nh_gw_family)
+	if (!fib6_nh->fib_nh_gw_family)
 		return;
 
 	nh_gw = &fib6_nh->fib_nh_gw6;

good catch. Thanks for the patch.

maintainer
#2 lore raw
In reply to Hangbin Liu

From: Hangbin Liu <[email protected]>
Date: Wed, 20 Nov 2019 15:39:06 +0800

Quoted 7 lines

Previously we will return directly if (!rt || !rt->fib6_nh.fib_nh_gw_family) in function rt6_probe(), but after commit cc3a86c802f0
("ipv6: Change rt6_probe to take a fib6_nh"), the logic changed to return if there is fib_nh_gw_family.

Fixes cc3a86c802f0 ("ipv6: Change rt6_probe to take a fib6_nh")

Applied and queued up for -stable.