From: Gabriel Goller <g.goller@proxmox.com>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] ipv6: reset all.force_forwarding when disabling all.forwarding
Date: Thu, 12 Nov 2026 14:43:41 +0100 [thread overview]
Message-ID: <avW_Yn2W7tSHTMaq@luna.proxmox.com> (raw)
In-Reply-To: <1eb85d22-7d2b-460c-82f6-2af15a4875dc@6wind.com>
On 10.11.2026 18:34, Nicolas Dichtel wrote:
> Le 09/11/2026 à 16:53, Gabriel Goller a écrit :
> > Disabling all.forwarding resets force_forwarding on every interface, but
> > leaves all.force_forwarding set:
> >
> > # sysctl -wq net.ipv6.conf.all.forwarding=1
> > # sysctl -wq net.ipv6.conf.all.force_forwarding=1
> > # sysctl -wq net.ipv6.conf.all.forwarding=0
> > # sysctl net.ipv6.conf.dummy1.force_forwarding
> > net.ipv6.conf.dummy1.force_forwarding = 0
> > # sysctl net.ipv6.conf.all.force_forwarding
> > net.ipv6.conf.all.force_forwarding = 1
> >
> > Writing 1 to all.force_forwarding afterwards is ignored because the
> > value did not change, so the interfaces are not re-enabled.
> >
> > Reset all.force_forwarding too and notify netconf listeners.
> >
> > Suggested-by: Ido Schimmel <idosch@nvidia.com>
> > Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
>
> There is the same effect if an interface entry is reset:
>
> $ sysctl -wq net.ipv6.conf.all.force_forwarding=1
> $ sysctl net.ipv6.conf.ntfp1.force_forwarding net.ipv6.conf.all.force_forwarding
> net.ipv6.conf.ntfp1.force_forwarding = 1
> net.ipv6.conf.all.force_forwarding = 1
> $ sysctl -wq net.ipv6.conf.ntfp1.force_forwarding=0
> $ sysctl net.ipv6.conf.ntfp1.force_forwarding net.ipv6.conf.all.force_forwarding
> net.ipv6.conf.ntfp1.force_forwarding = 0
> net.ipv6.conf.all.force_forwarding = 1
> $ sysctl -wq net.ipv6.conf.all.force_forwarding=1
> $ sysctl net.ipv6.conf.ntfp1.force_forwarding net.ipv6.conf.all.force_forwarding
> net.ipv6.conf.ntfp1.force_forwarding = 0
> net.ipv6.conf.all.force_forwarding = 1
>
> Maybe the new value should be applied whatever the old value was for the 'all'
> entry (like for net.ipv6.conf.all.forwarding).
>
> Note that, it is the same for ipv4 forwarding:
>
> $ sysctl -wq net.ipv4.conf.all.forwarding=1
> $ sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.ntfp1.forwarding
> net.ipv4.conf.all.forwarding = 1
> net.ipv4.conf.ntfp1.forwarding = 1
> $ sysctl -wq net.ipv4.conf.ntfp1.forwarding=0
> $ sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.ntfp1.forwarding
> net.ipv4.conf.all.forwarding = 1
> net.ipv4.conf.ntfp1.forwarding = 0
> $ sysctl -wq net.ipv4.conf.all.forwarding=1
> $ sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.ntfp1.forwarding
> net.ipv4.conf.all.forwarding = 1
> net.ipv4.conf.ntfp1.forwarding = 0
>
> but not for ipv6 forwarding:
> $ sysctl -wq net.ipv6.conf.all.forwarding=1
> $ sysctl net.ipv6.conf.all.forwarding net.ipv6.conf.ntfp1.forwarding
> net.ipv6.conf.all.forwarding = 1
> net.ipv6.conf.ntfp1.forwarding = 1
> $ sysctl -wq net.ipv6.conf.ntfp1.forwarding=0
> $ sysctl net.ipv6.conf.all.forwarding net.ipv6.conf.ntfp1.forwarding
> net.ipv6.conf.all.forwarding = 1
> net.ipv6.conf.ntfp1.forwarding = 0
> $ sysctl -wq net.ipv6.conf.all.forwarding=1
> $ sysctl net.ipv6.conf.all.forwarding net.ipv6.conf.ntfp1.forwarding
> net.ipv6.conf.all.forwarding = 1
> net.ipv6.conf.ntfp1.forwarding = 1
Makes sense, aligned the behavior to ipv6 forwarding with this patch:
https://lore.kernel.org/all/20261112-ipv6_always_apply-v1-1-8df846631005@proxmox.com/
This patch is still relevant.
Thanks for the review.
Gabriel
next prev parent reply other threads:[~2026-11-12 13:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 15:53 Gabriel Goller
2026-11-10 17:34 ` Nicolas Dichtel
2026-11-12 13:43 ` Gabriel Goller [this message]
2026-11-11 3:53 ` netdev-bot+sashiko
2026-11-12 12:45 ` Gabriel Goller
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=avW_Yn2W7tSHTMaq@luna.proxmox.com \
--to=g.goller@proxmox.com \
--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-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
/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 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®