Article View: linux.kernel.netdev
Article #13272[PATCH net-next] ipv6: reset all.force_forwarding when disabling all.forwarding
From: Gabriel Goller
Date: Mon, 09 Nov 2026 15:53
Date: Mon, 09 Nov 2026 15:53
51 lines
9159 bytes
9159 bytes
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>
---
net/ipv6/addrconf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d9d13e78bf13..9007a58039e6 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -905,6 +905,14 @@ static int addrconf_fixup_forwarding(const struct ctl_table *table, int *p, int
net->ipv6.devconf_dflt);
addrconf_forward_change(net, newf);
+ /* Disabling all.forwarding also resets all.force_forwarding */
+ if (newf == 0 && net->ipv6.devconf_all->force_forwarding) {
+ WRITE_ONCE(net->ipv6.devconf_all->force_forwarding, 0);
+ inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,
+ NETCONFA_FORCE_FORWARDING,
+ NETCONFA_IFINDEX_ALL,
+ net->ipv6.devconf_all);
+ }
if ((!newf) ^ (!old))
inet6_netconf_notify_devconf(net, RTM_NEWNETCONF,
NETCONFA_FORWARDING,
---
base-commit: fa5196392691051963726787944db872420dfa75
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main
change-id: 20261109-ipv6_reset_all-1452fdf29254
Best regards,
--
Gabriel Goller <g.goller@proxmox.com>
Technical Details
Message-ID:
<20261109-ipv6_reset_all-v1-1-815dfd508246@proxmox.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359404-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359404-linux-kernel-netdev=dewy.ru From: g.goller@proxmox.com (Gabriel Goller) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next] ipv6: reset all.force_forwarding when disabling all.forwarding Date: Mon, 09 Nov 2026 16:53:08 +0100 Organization: Usenet Network Message-ID: <20261109-ipv6_reset_all-v1-1-815dfd508246@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="394047"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:vOUV/ndDNMqGnXSq1oPvOmWZgKc= sha256:7pmikchSBgyPyNvWQkGMLIPIRIqn9SHyX9cTiDESEFI= sha1:2ACYqYQ1yM+MZarmJU0mFeUBYXU= sha256:7qLG1sqwJp7TOMONvv9jCFtFa0FxfevGfsBkN45lXJw= 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 6AB9D113865; Mon, 9 Nov 2026 19:03:02 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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-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 DNA4oYblwpAA; Mon, 9 Nov 2026 19:02:58 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-359404-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=proxmox.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 8B76E11383F; Mon, 9 Nov 2026 19:02:53 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 3C9D9C5612; Mon, 9 Nov 2026 15:54:40 +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=1794239656; b=V6FMecWXgu83we/hwJji54ePO9yMcPIm8vRFRvjOUU6quTiMhINwWTLP4W4yjClDbCao 1Vh4TybgGgqz0+EzSALuEV5uwssi0fSsJ1H1f0rysPD+fe08fs3lnUXUbiksolot2Roem GjGkzfa8iGXDFjA8TLbx1jLCx0DLMlnUnysPz8Ce6monE5pjrBBL9R0pz/BdDNC/wpBRE 02esdIPf+BRMJXy+rhz4h0S5FxO06SRz4S1Za7SdWPoGOF8nKGbMAGLKtM5JA53IQnEqm ugPI3APm+AN27uHYaXTSn59d3mLhIDTDBFX9v80Tf3Gww8Cepo1kd9ZAP22OHaBODrA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794239656; h=X-Original-To:Received:DMARC-Filter:Received:From:Date:Subject: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:X-B4-Tracking:X-Change-ID:To:Cc: X-Mailer:X-Bm-Milter-Handled:X-Bm-Transport-Timestamp; bh=gTMNEF6dJw/O7kf712eKlMX49QBXLH8dHRmAe13jRSM=; b=GsTm5LcwJi1lkgy54K+tknjPRZL1v5rov7GwsA8RapxLN45TSzL85jcIFgjviXv0LHer oow2ywtQj3RSt6OGKNWSss+lXfNeX+yKJ1EjLFp3blgd8oNzZDILz8aIbNmvSDAF+E0Oy 4IjOmuu+KeImwQzOejO7/mA9qMk46/iuRhnrp9DDUrqiks76dlcO5CvlKUPdwr3m0zZ55 6hjl5vonSdH7kfjRNN7Ah4fYv1Ba/mQDeBXjf1CswEgSHswnbtL//GmHMijH/Wv7at4v6 7OSlL1umT4fhwwujHcqvIQC+96hGldj5u4TA/7ehPGLlh5gsM5GZEnChqperQ8hM+7Q== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; 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 2988E606A33C; Mon, 9 Nov 2026 15:54:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=94.136.29.106 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794239655; b=CUvsKhLmk/W8e7Gq7bXKOE39r4ClOZGOCmPAkDc0AvGBrBILm8F/YGa0HWLMzVpwwVdV QA/nZD33Gfs9szRRhymSXIUmztSyd5+oMLBB1mvp2jeq/ZEBcUtCbBRcwji2Jga9DBB0m 6cB9J3fbe3Q2gVykyG6d95fytxPtN8yekBzdEarCONjt/aIxcY/0c1t+YBcShOIn1CwJV 9oRgVITplDO4U6KoFqIWxhoh3xFakRseXrO8vsV/401sXdpkqPg1YAgydaUuuwdG5rOTG 2sn8Ak8yya7Thyf1rnatwolJHEQH9SNFrQ9AJ+huWU2U/WPsSZaXvKqX61tYj8XkGgQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794239655; h=DMARC-Filter:Received:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:X-B4-Tracking:X-Change-ID:To:Cc: X-Mailer:X-Bm-Milter-Handled:X-Bm-Transport-Timestamp; bh=gTMNEF6dJw/O7kf712eKlMX49QBXLH8dHRmAe13jRSM=; b=Ks2E6nwkPxy2GvDtDJOiRFghcauGdzodRcKk9su/ydE3HZN9PPxuU7IwhnbfGNfviI9B 9wvQrLznpKFopx4R4aU3dirv7KXYAcx9dzRzZfmAJoy0xZu4LJYZK5+ExxkUDIJJRrJXr tz9sJYwlqCD579vsYkFOf2W2xMekktRwv/p+IVjHuwhViV/OVHxyu9427auKQ8vPu1Pgi S3rpDYySKGdNVlsrDiJc06We0gBlW9P3p/+Qyy3lra9XZxZihzhrdt7a998ZLZ+m4jdyq t2RjoQGTQ/rgHnQbrtepivQJ7XhmqdcYdUGzgugwMdMHWhwrt87SyQcpwlTG5z7hUEQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; arc=none smtp.remote-ip=94.136.29.106 X-Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A6A606A31C; Mon, 9 Nov 2026 15:54:12 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 59A6A606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proxmox.com X-Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1ED9D48124; Mon, 09 Nov 2026 16:54:05 +0100 (CET) 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 X-B4-Tracking: v=1; b=H4sIAHDs8WoC/yWMUQqDMBAFryL7bcAsKtirFBGrL3VFUsmmIoh3N 7WfwzBzkCIIlB7ZQQGbqHx8AptnNEy9f8PImJi44NraojGybnUXoIhdvyzGlhW70XHDVUkpWgO c7PfwSR7ReOyR2r/R72vGEH8/Os8L8jjE5HwAAAA= X-Change-ID: 20261109-ipv6_reset_all-1452fdf29254 X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Gabriel Goller <g.goller@proxmox.com> X-Mailer: b4 0.17-dev X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794239643547