🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16694

Re: [PATCH net-next] ipv6: always apply all.force_forwarding to every interface

#16694
From: netdev-bot+sashiko
Date: Sun, 15 Nov 2026 16:02
95 lines
11609 bytes
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()?

> +    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: <179475857004.2199510.11986005836315752622@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363757-linux-kernel-netdev=dewy.ru
References: <20261112-ipv6_always_apply-v1-1-8df846631005@proxmox.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363757-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] ipv6: always apply all.force_forwarding to every
 interface
Date: Sun, 15 Nov 2026 16:02:50 +0000
Organization: Usenet Network
Message-ID: <179475857004.2199510.11986005836315752622@kernel.org>
References: <20261112-ipv6_always_apply-v1-1-8df846631005@proxmox.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1845751"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DbiPqd8HJbdiiyfzMYMAxLjNkrg= sha256:EflXltuPxRn9X7JZmwPksDlv8AwXyeROkDmSF+w7QM0=
	sha1:44AeQrnZrFr3PQXC9hEXe2gbE10= sha256:ZCtKFdg83vkjPoqxFi6LHnfpNRhevp3tNbBlLO6c+kQ=
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 D8560114A06; Sun, 15 Nov 2026 19:03:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 Alcbl0oSpnee;
	Sun, 15 Nov 2026 19:03:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363757-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id BD3CE1144D3; Sun, 15 Nov 2026 19:03:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 877663565E; Sun, 15 Nov 2026 16:02:53 +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=1794758572;
	b=brdz8WHCtEpvqyYoU4CFs0qhrXqphLh3Za5FXXSX+WFPKK2q6OEfWUA79SXk3H28BiV8
	 blxj7sJtyLDQyj6f5iVlodOXx+Ikj0HnZ2ony1euxgfCSDxxyv1mVtmZVQMKDP5rYmPQQ
	 lERumIbYDfIhXD+VZwmN+FdoCrlGxAC2eR8eRzpjrKcrQq+1iQMeGp0EhhoPW3LMoGBnd
	 /ghhyTWO/3MS3sMzwZhPGKccDyfa/IKZoBrwgB+9faQh3879ERhy64UIVOnc8W2bF37TD
	 55jbw2cejtIERD8cho01CKtw/tSpK+JiZFmAvPL80KHNuCzOfqaEJ9eY8/x/w9oh00w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794758572;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=6o20K47FTSJ3fNc9dXoLvvdyjdlNctQb9/oL/0Ev1js=;
	b=PNj3d4cSEFefdcfD+97H2+BZzcLFOxF/bWKyExHcZPeahkDpsQGj9M1PUaCzNpIIpaNR
	 mOhwChc5iYAU0oW8Dk/6+HJnfJ6RBiqIAPHvN++Q31J8uXobgBsaWxyKjdDc8dcle677c
	 O3ERDn/MEz9cXLy7zYriq7wjwC9nHmaEmqxyRKIKfYFJHGDn7oE54yVze3jtloRij5r3W
	 gZPc7VFOb3wtyxmD1myS87qh8kyBSwCAbd8WL6/Jy5xJTeTTy5x3DNu1sjHLh4rs07Glg
	 l/RCfS2p14GYOBo0wl4M3UuHuKOIfQDIf1sNb2I/0fJEA2WZ25C7U09M2W9flAatuNA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VmFDLa7Q;
	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 87A3B606A31E;
	Sun, 15 Nov 2026 16:02:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VmFDLa7Q
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794758571;
	b=wYrUFtwigsGho4WoWxUe9ov5F2qZl/VbmQrvJeYHtJdVkRQuzRTM1s3lvBSCzgRv7Z+e
	 AzenZvIwwvpMOWwTOJCDjF2r1b7aFhIF9PeusDZcp9N0KaPSfn9JFGn39i88+Bz4kKnQT
	 G7my4TI6Vxf9CsDKLLa9NJYbbjXv1eZ7b2TIMjS3bJEc11IwhkdVGBmLnsp+Ekxev5DvD
	 /Nr9D4+k9qVmiDqlMCJ8hn8hteCOxXLgk/G9lzHydcafUM6t+r+yWZgjFAc5AsE1j3zau
	 OKihfEKATkqxPn5hodWGZxmgq7fMJusHCuEnQb7M5dCghw+M0D4z/UDvG3qowjc6xFg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794758571;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=6o20K47FTSJ3fNc9dXoLvvdyjdlNctQb9/oL/0Ev1js=;
	b=AZTB/P+PYzUwHAmKYDsyF8QeeACe63SZxmpQNcrU6GfELrbPEBRWb4/LULMxu9lxrY3Z
	 xCavrNUy5wr+OMzp5pOKTVqWw/v3ms3ts8yQeG1jk5YoYQ8trBYALsSNmlRgiDgL761pl
	 MHwHj/LSQ8Qs0ljiaTRpMHNdqD9sduUih1zLQ6nx3s7Ip59TsszPhNrIUa7Ixz8xRuagx
	 YuhEcTIasgJrmD3EydfLkd7ufW3GXVHAt7uCp8zfDRmbUrVm64YElfciX9ER/KkVSKOms
	 uQ4bwtXuwrbxohuxQoTn1ZuCVOaQHVL6WtNdbotL+hUecL61CuwHM+q10RjHvUr/r4A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VmFDLa7Q;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A892C606A338;
	Sun, 15 Nov 2026 16:02:51 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77C961F000C7;
	Sun, 15 Nov 2026 16:02:50 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794758571;
	bh=6o20K47FTSJ3fNc9dXoLvvdyjdlNctQb9/oL/0Ev1js=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=VmFDLa7QcLRWoMu+ysh3hNyWjCSJ9ZR8GTmWzU/4FQS3A1ZxjjELnasXlBcjvFxmM
	 VOU3H0ZJkraZVkXzQ0QZnvSb7UGMQWJ3C/+SryCvv5JPvQ3qM+t8sJ28hNOADmgqCw
	 cl7EIs9qPpbk8peyNtx/UMgwBwP7yPZxScg89pzZcOeJWrgdtT47UKtJ5aXtPIre+O
	 3sGFBO25KB46ZfWdSs6Y8BDSMZ+D1qmDEE3qAuIV7eDsSsg9f8qDDEJF3ToBTuSg7I
	 yZZNE2bmWFJn7gZirm1y9aLxERy2IDkIKWQ268mtuL+hFrj4vY2vnHXCykg/v7WwMk
	 vt8yQrmWcLAlA==
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-In-Reply-To: <20261112-ipv6_always_apply-v1-1-8df846631005@proxmox.com>
X-sashiko-severity: Medium
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