From patchwork Tue Mar 28 15:38:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 76185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2336732vqo; Tue, 28 Mar 2023 09:12:40 -0700 (PDT) X-Google-Smtp-Source: AKy350Y194cS9Fml2jzxRmZ89hNmqKKu/QeWOwbxKpD80uMaN+TeVDzDwWHcWO3tqPEEq72tujAP X-Received: by 2002:a17:907:7784:b0:930:e2c:ddc3 with SMTP id ky4-20020a170907778400b009300e2cddc3mr16327916ejc.72.1680019960449; Tue, 28 Mar 2023 09:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680019960; cv=none; d=google.com; s=arc-20160816; b=wya8ob1URiOGuukI5ldhw/H6cCyhot67UT77lUWkFZMPQ6VlRwStMAEBLl2uQwjiwC te8P6y8vG9DiajbQULxLU7nxZWe/nHhcAU+ogAMCQmujNQ3nJBaQVkalK7Ja64WOAY9/ lFaiwFZYYzcK79i1lY5U7gYR+ij5WKpgkoYL4rbptarnBW9VO8gM+GbmQx5uIRq7NVU8 6X8aRZ7nfj7+jknY4h9V4QZRNvu511MuUixdm9QCHmAOupPWEHVD02k/r8ayVNM3MbQR IsvtsVkZueR/Ta7GxG1M3Q8MI9IZFf/LK/OyG60g8axpK+1wLXrj0bFzwdRn5uuzBAvM ayZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=KfTeWyZgRkVVCzSjkmUbvzItYG2kxlspDdquUfw+3s4=; b=I9VrsZAby94xz4TfZrM7K4suc+pg8L6aX7+zVAXQ7YVqmI9tzBgzcAyCXAOE5Qb50l +Peii8G6fh9nt5UUHt1bbduAmaDgDfNLTPZhiTTZMBV3RgzQRqOSReg2jn0JfIOu20N/ rYZi9zWyZ0zB0zrLT+gb3fQnVyAOeHR+QUEGqmtzSbF9O3/PfViiKbVgQI13nXEP9s7I ptVhxJyrSvWEiukisZCnNBbODolIsHwqTeafhLAs9Pw9uAJQmX9o0j44le+UAAPKPERf +N7Px0XLRdQ7ykUsyYHhDJiCZeb+yUHEFnUmY67uEBWGPPaae3nFtPCP1+YFRs8D/EJS hkWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=guGB8+Rr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a170906970700b0093cd9fa2838si12880406ejx.1009.2023.03.28.09.12.16; Tue, 28 Mar 2023 09:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=guGB8+Rr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232597AbjC1P5x (ORCPT + 99 others); Tue, 28 Mar 2023 11:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232190AbjC1P5v (ORCPT ); Tue, 28 Mar 2023 11:57:51 -0400 X-Greylist: delayed 600 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 28 Mar 2023 08:57:46 PDT Received: from mail.kmu-office.ch (mail.kmu-office.ch [IPv6:2a02:418:6a02::a2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8FD31B8; Tue, 28 Mar 2023 08:57:46 -0700 (PDT) Received: from allenwind.lan (unknown [IPv6:2a02:169:3df5:10::ed4]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 03B275C2C8A; Tue, 28 Mar 2023 17:38:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1680017938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=KfTeWyZgRkVVCzSjkmUbvzItYG2kxlspDdquUfw+3s4=; b=guGB8+Rrwrpxv4DLYA35WaapR78I1JPZ9mpEwYONgOfnVFdSm1ELxdQ5fyNx+bepZvQ/Oo Eo7yF4YLKGCgLkvJHtgERA3jcgTAzsjRKNc2dRaFtKihjMHfJYZvydXI7Q2jGpL44EbO3c Get5VPGCwGUF9Ssj187KN2cYr0/DSW4= From: Stefan Agner To: davem@davemloft.net, dsahern@kernel.org Cc: edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, stefan@agner.ch, john.carr@unrouted.co.uk, linux-kernel@vger.kernel.org Subject: [RFC PATCH] ipv6: add option to explicitly enable reachability test Date: Tue, 28 Mar 2023 17:38:50 +0200 Message-Id: X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761628610154867864?= X-GMAIL-MSGID: =?utf-8?q?1761628610154867864?= 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 --- 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();