[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250702091055.3d70a5ee@kernel.org>
Date: Wed, 2 Jul 2025 09:10:55 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: Gabriel Goller <g.goller@...xmox.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Simon Horman <horms@...nel.org>, Jonathan Corbet
<corbet@....net>, David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] ipv6: add `force_forwarding` sysctl to enable
per-interface forwarding
On Wed, 2 Jul 2025 17:14:42 +0200 Nicolas Dichtel wrote:
> > Should we invert the polarity? It appears that the condition below only
> > let's this setting _disable_ forwarding. IMO calling it "force" suggests
> > to the user that it will force it to be enabled.
> Not sure to follow you. When force_forwarding is set to 1 the forwarding is
> always enabled.
>
> sysctl | all.forwarding | iface.force_forwarding | packet processing from iface
> | 0 | 0 | no forward
> | 0 | 1 | forward
> | 1 | 0 | forward
> | 1 | 1 | forward
Ugh, I can't read comparisons to zero.
Let's switch to more sane logic:
if (idev && !READ_ONCE(idev->cnf.force_forwarding) &&
!READ_ONCE(net->ipv6.devconf_all->forwarding))
Powered by blists - more mailing lists