mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH] ipv6: add option to explicitly enable reachability test
@ 2023-03-28 15:38 Stefan Agner
  2023-03-28 17:54 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Agner @ 2023-03-28 15:38 UTC (permalink / raw)
  To: davem, dsahern
  Cc: edumazet, kuba, pabeni, netdev, stefan, john.carr, linux-kernel

Systems which act as host as well as router might prefer the host
behavior. Currently the kernel does not allow to use IPv6 forwarding
globally and at the same time use route reachability probing.

Add a compile time flag to enable route reachability probe in any
case.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
My use case is a OpenThread device which at the same time can also act as a
client communicating with Thread devices. Thread Border routers use the Route
Information mechanism to publish routes with a lifetime of up to 1800s. If
one of the Thread Border router goes offline, the lack of reachability probing
currenlty leads to outages of up to 30 minutes.

Not sure if the chosen method is acceptable. Maybe a runtime flag is preferred?

--
Stefan

 net/ipv6/Kconfig | 9 +++++++++
 net/ipv6/route.c | 3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 658bfed1df8b..5147fd4c93ff 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -48,6 +48,15 @@ config IPV6_OPTIMISTIC_DAD
 
 	  If unsure, say N.
 
+config IPV6_REACHABILITY_PROBE
+	bool "IPv6: Always use reachability probing (RFC 4191)"
+	help
+	  By default reachability probing is disabled on router devices (when
+	  IPv6 forwarding is enabled). This option explicitly enables
+	  reachability probing always.
+
+	  If unsure, say N.
+
 config INET6_AH
 	tristate "IPv6: AH transformation"
 	select XFRM_AH
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0fdb03df2287..5e1e1f02f400 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2210,7 +2210,8 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table,
 
 	strict |= flags & RT6_LOOKUP_F_IFACE;
 	strict |= flags & RT6_LOOKUP_F_IGNORE_LINKSTATE;
-	if (net->ipv6.devconf_all->forwarding == 0)
+	if (net->ipv6.devconf_all->forwarding == 0 ||
+	    IS_ENABLED(IPV6_REACHABILITY_PROBE))
 		strict |= RT6_LOOKUP_F_REACHABLE;
 
 	rcu_read_lock();
-- 
2.40.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] ipv6: add option to explicitly enable reachability test
  2023-03-28 15:38 [RFC PATCH] ipv6: add option to explicitly enable reachability test Stefan Agner
@ 2023-03-28 17:54 ` Eric Dumazet
  2023-06-30 11:51   ` Stefan Agner
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2023-03-28 17:54 UTC (permalink / raw)
  To: Stefan Agner
  Cc: davem, dsahern, kuba, pabeni, netdev, john.carr, linux-kernel

On Tue, Mar 28, 2023 at 5:39 PM Stefan Agner <stefan@agner.ch> wrote:
>
> Systems which act as host as well as router might prefer the host
> behavior. Currently the kernel does not allow to use IPv6 forwarding
> globally and at the same time use route reachability probing.
>
> Add a compile time flag to enable route reachability probe in any
> case.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> My use case is a OpenThread device which at the same time can also act as a
> client communicating with Thread devices. Thread Border routers use the Route
> Information mechanism to publish routes with a lifetime of up to 1800s. If
> one of the Thread Border router goes offline, the lack of reachability probing
> currenlty leads to outages of up to 30 minutes.
>
> Not sure if the chosen method is acceptable. Maybe a runtime flag is preferred?

I guess so. Because distros would have to choose a compile option.

Not a new sysfs, only an IFLA_INET6_REACHABILITY_PROBE ?

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] ipv6: add option to explicitly enable reachability test
  2023-03-28 17:54 ` Eric Dumazet
@ 2023-06-30 11:51   ` Stefan Agner
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Agner @ 2023-06-30 11:51 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: davem, dsahern, kuba, pabeni, netdev, john.carr, linux-kernel

Hi Eric,

On 2023-03-28 19:54, Eric Dumazet wrote:
> On Tue, Mar 28, 2023 at 5:39 PM Stefan Agner <stefan@agner.ch> wrote:
>>
>> Systems which act as host as well as router might prefer the host
>> behavior. Currently the kernel does not allow to use IPv6 forwarding
>> globally and at the same time use route reachability probing.
>>
>> Add a compile time flag to enable route reachability probe in any
>> case.
>>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> ---
>> My use case is a OpenThread device which at the same time can also act as a
>> client communicating with Thread devices. Thread Border routers use the Route
>> Information mechanism to publish routes with a lifetime of up to 1800s. If
>> one of the Thread Border router goes offline, the lack of reachability probing
>> currenlty leads to outages of up to 30 minutes.
>>
>> Not sure if the chosen method is acceptable. Maybe a runtime flag is preferred?
> 
> I guess so. Because distros would have to choose a compile option.
> 
> Not a new sysfs, only an IFLA_INET6_REACHABILITY_PROBE ?
>

Wouldn't that be a per interface config? From what I can tell currently
the reachability probing is disabled when IPv6 forwarding is enabled on
a global level only. So I'd need something which disables that behavior
on a global only as well.

--
Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-30 12:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 15:38 [RFC PATCH] ipv6: add option to explicitly enable reachability test Stefan Agner
2023-03-28 17:54 ` Eric Dumazet
2023-06-30 11:51   ` Stefan Agner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®