Article View: linux.kernel.netdev
Article #17787Re: [PATCH net-next] ipv6: always apply all.force_forwarding to every interface
From: Gabriel Goller
Date: Tue, 17 Nov 2026 10:33
Date: Tue, 17 Nov 2026 10:33
103 lines
11776 bytes
11776 bytes
On 15.11.2026 16:02, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] The new selftest test_all_force_forwarding() in
> tools/testing/selftests/net/ipv6_force_forwarding.sh fails every time…
>
> --
>
> ipv6: always apply all.force_forwarding to every interface
>
> This commit changes addrconf_sysctl_force_forwarding() so that every write
> to all.force_forwarding is applied to all interfaces, even when the stored
> value does not change. It now takes RTNL for every write and sends netconf
> notifications only for actual value changes. It also extends the
> ipv6_force_forwarding.sh selftest to cover the new behaviour.
>
> > diff --git a/tools/testing/selftests/net/ipv6_force_forwarding.sh b/tools/testing/selftests/net/ipv6_force_forwarding.sh
> > index bf0243366caa7..383d1ec64f1c1 100755
> > --- a/tools/testing/selftests/net/ipv6_force_forwarding.sh
> > +++ b/tools/testing/selftests/net/ipv6_force_forwarding.sh
>
> [ ... ]
>
> > +test_all_force_forwarding() {
> > + local ret=0
> > +
> > + echo "TEST: all.force_forwarding"
> > +
> > + ip netns exec $ns2 sysctl -qw net.ipv6.conf.veth21.force_forwarding=0 || return 1
> > + ip netns exec $ns2 sysctl -qw net.ipv6.conf.all.force_forwarding=1 || return 1
> > + check_force_forwarding veth21 1 "all.force_forwarding applied to interfaces" || ret=1
>
> [ ... ]
>
> > + # Disabling all.forwarding resets force_forwarding, including on all
> > + ip netns exec $ns2 sysctl -qw net.ipv6.conf.all.forwarding=1 || return 1
> > + ip netns exec $ns2 sysctl -qw net.ipv6.conf.all.forwarding=0 || return 1
> > + check_force_forwarding all 0 "all.forwarding=0 resets all.force_forwarding" || ret=1
>
> [Severity: Medium]
> Can this check ever pass? Earlier in test_all_force_forwarding() the
> script writes all.force_forwarding=1, which stores 1 in
> net->ipv6.devconf_all->force_forwarding.
>
> The later all.forwarding=0 write goes through
> addrconf_sysctl_forward()->addrconf_fixup_forwarding(). The devconf_all
> branch there only updates devconf_dflt->forwarding and then calls
> addrconf_forward_change(net, 0).
>
> addrconf_forward_change() clears force_forwarding only in the
> per-device configs:
>
> net/ipv6/addrconf.c:addrconf_forward_change() {
> ...
> for_each_netdev(net, dev) {
> idev = __in6_dev_get_rtnl_net(dev);
> if (idev) {
> ...
> if (newf == 0 && idev->cnf.force_forwarding) {
> WRITE_ONCE(idev->cnf.force_forwarding, 0);
> ...
> }
>
> Nothing resets devconf_all->force_forwarding (or
> devconf_dflt->force_forwarding) when forwarding is disabled. So
> sysctl -n net.ipv6.conf.all.force_forwarding should still return 1 at
> this point. The check would then print "FAIL: all.forwarding=0 resets
> all.force_forwarding (got 1, expected 0)", and the script would exit 1
> on every run.
>
> ip-sysctl.rst says the flag "will be reset on all interfaces". That
> matches the code, not this assertion.
>
> Should this assertion be dropped, or changed to expect 1? Or is the
> intent for all.forwarding=0 to also reset conf/all/force_forwarding in
> addrconf_fixup_forwarding()?
Already fixed with
a76e8bf4be55 ("ipv6: reset all.force_forwarding when disabling all.forwarding")
AFAICS.
I should have added a b4 dependency on that patch, then maybe sashiko wouldn't
flag this...
> > + check_force_forwarding veth21 0 "all.forwarding=0 resets interface force_forwarding" || ret=1
> > +
> > + return $ret
> > +}
>
> [ ... ]
>
> --
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-ipv6_always_apply-v1-1-8df846631005%40proxmox.com
Technical Details
Message-ID:
<avwtH0OKZzGYQ1lW@luna.proxmox.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365166-linux-kernel-netdev=dewy.ruReferences:
<20261112-ipv6_always_apply-v1-1-8df846631005@proxmox.com> <179475857004.2199510.11986005836315752622@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365166-linux-kernel-netdev=dewy.ru From: g.goller@proxmox.com (Gabriel Goller) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next] ipv6: always apply all.force_forwarding to every interface Date: Tue, 17 Nov 2026 11:33:33 +0100 Organization: Usenet Network Message-ID: <avwtH0OKZzGYQ1lW@luna.proxmox.com> References: <20261112-ipv6_always_apply-v1-1-8df846631005@proxmox.com> <179475857004.2199510.11986005836315752622@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2303788"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:db9FObm79m3P1+QX8lpWuP0TP6E= sha256:/bd2vLF36VpkUIs8NXOMFpEk0EjD26O+WPftbsKXMaw= sha1:UXegSc54VFe0BmLMb76bAf5T5Ic= sha256:VBjT+qVidapw0pQTLiRcwMAHq+mzT6Gt+/Lo3LJdAQQ= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5AD51114EFE; Tue, 17 Nov 2026 13:34:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.951 X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 35cliIv6mbWP; Tue, 17 Nov 2026 13:34:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-365166-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=proxmox.com X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 1ED8F114EF9; Tue, 17 Nov 2026 13:34:07 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id AA81029124; Tue, 17 Nov 2026 10:34:04 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794911640; b=BJqTkiZdYASE0zQ23IapCvM84jMoO+hgbFQ/G0WbiAZg1g/lOPJ4q+W+OsTZe+IbV1Gb ZrSw2l6Kk70ecU6wvlQDadDG6ps9lIkuTcUT1ZX71zxhDLqsouL4R3Xep1WlGsfwhNtZ3 fZwS/IF62XnxIRHxyjAGrNjNextMs5PQF+kWmqsxKCJw9qp9Uw5E+OQpc/2l7xB/6vj1m stizgPIVganZ5Q+/G8iRQ+B+e2UuorN+dpCjw1F/a75kZSiNmcC4AH+mlAMRzkUIJ1DCq d8MWpM5J0tVNbOtLCrFrelKRV1nEJSjCFEyIWiYciCBu3LRf/L0V/6+p9SJsOB/4QMw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794911640; h=X-Original-To:Received:DMARC-Filter:Received:Date:From:To:Cc:Subject: Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To:User-Agent:X-Bm-Milter-Handled:X-Bm-Transport-Timestamp; bh=Mwp2JsfQ9y1vNZwCYUi5p1qF6/L43HTWSe+6S+JCKms=; b=yUdch7GcAYwYM+M2yCQ+nIddrE4akCpvYJrnvcitV2VhmSk5PRo3SDs0VkIj1bDkycby 5qNVpDcBz42So/TzKnxzU9zU8nmkUDdP2bAKXC3ZBtOp1iozDxsTkLWvnrS720TlJ2xM9 IeOaPe7nQ5pBuFY05M24XTt9hd4IkWcK1xQvEm8Kyepg7pnw+T5EyxY5kWoAiN/WmGj2O wwLDKfIuXqDUh/oWkCN5HiEp9C2LR5w7jMj23LvJYdwgqBAjM0JtSxeaSI+oWFkgcj1RT h+abvUdhRMUABsE86xOpWGcranOIx0w29nCAoLxJGNQaISOVHf5NQJqUcZGMUnuxNHg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FEB7606A323; Tue, 17 Nov 2026 10:34:00 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=94.136.29.106 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794911630; b=w5xgkmjjTu581xivRgSNGAj8oIaHk9t00TlNpso0X2x8COZAG4jGDZm4dOYPEjOCRxlx V8R6T881D8/JZ8j6QCN78CXP8dSd1QI7tPK1hh7m1DhhUMNxmQbtZhHr920a4LQfcq+ZJ flR2JJm6FW/I1IWRsCqi7c4pj9MHg9bddLB9EzM7NtjgCtUsv6dr3LcDO44sxH+r5nsQs henCTeZ84ahxSreol4kOkEJQ8xL00n44dpq4by2s/StPkoSRcWxlAmSMwoR5mWTT/1wnc 5vKZrmp0tqBqLLTJVNdS4ThbTnlERAJB1YswIOKgCXW8uEvRbP2zkcfSg1eXtAxBLSQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794911630; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To:User-Agent:X-Bm-Milter-Handled: X-Bm-Transport-Timestamp; bh=Mwp2JsfQ9y1vNZwCYUi5p1qF6/L43HTWSe+6S+JCKms=; b=U4l6AnoCs9g/R5or6MokGyeHxaK4QJYelXU1KZpVH4rJ0BgvhAPealh2hh3bNE8yT5y2 EkCN4CBSIFC0vljm4vBLrvQ2z0zd5+Upi9Mk+uRMOYs2vZ8Uzk7LIXOzDfM8cmhNGPaYi 8KGAiUVEUNDa1Ed+0Uyy+4eGsFiWIf6Sjb5jrvIv5rNe0EKAn1TqurwTHzeIhXAyMCnSI qzoosAQ7VQzbARPezz4J01xzvGzu38aSO2cy5c/Aw9Mi0OMWrAs2t9HjzhmEnSaPqnGXJ SkQpImBJpjD9Q/PTRsulataqDeuQTE68mxPoq8OUJc44e0UXqh1rwoDNwRE0EhVGcyA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; arc=none smtp.remote-ip=94.136.29.106 X-Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD249606A31C; Tue, 17 Nov 2026 10:33:48 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CD249606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proxmox.com X-Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 18E03486D2; Tue, 17 Nov 2026 11:33:41 +0100 (CET) X-Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, dsahern@kernel.org, idosch@nvidia.com, nicolas.dichtel@6wind.com, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <179475857004.2199510.11986005836315752622@kernel.org> X-User-Agent: NeoMutt/20260504 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794911619870