Re: [PATCH v3] ipv6: add `force_forwarding` sysctl to enable per-interface forwarding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02.07.2025 09:10, Jakub Kicinski wrote:
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))

Agree!

Thanks for the review.





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux