From: Gabriel Goller <g.goller@proxmox.com>
To: netdev-bot+sashiko@kernel.org
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
Subject: Re: [PATCH net-next] ipv6: always apply all.force_forwarding to every interface
Date: Tue, 17 Nov 2026 11:33:33 +0100 [thread overview]
Message-ID: <avwtH0OKZzGYQ1lW@luna.proxmox.com> (raw)
In-Reply-To: <179475857004.2199510.11986005836315752622@kernel.org>
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
next prev parent reply other threads:[~2026-11-17 10:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 13:41 [PATCH net-next] ipv6: always apply all.force_forwarding to every interface Gabriel Goller
2026-11-12 16:26 ` Nicolas Dichtel
2026-11-15 16:02 ` netdev-bot+sashiko
2026-11-17 10:33 ` Gabriel Goller [this message]
2026-11-17 15:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avwtH0OKZzGYQ1lW@luna.proxmox.com \
--to=g.goller@proxmox.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.