[PATCH net] ipv6: Add NETCONFA_FORCE_FORWARDING to netconf messages

From: Gabriel Goller

Date: Fri Oct 23 2026 - 07:02:18 EST


Since force_forwarding was added, changing the sysctl sends an
RTM_NEWNETCONF notification of type NETCONFA_FORCE_FORWARDING, but
inet6_netconf_fill_devconf() never emits the attribute. Listeners only
receive NETCONFA_IFINDEX without the new value, and RTM_GETNETCONF
replies and dumps omit it as well.

Fixes: f24987ef6959 ("ipv6: add `force_forwarding` sysctl to enable per-interface forwarding")
Signed-off-by: Gabriel Goller <g.goller@xxxxxxxxxxx>
---
net/ipv6/addrconf.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c8c0dd04982d..1b8caf6f4f16 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -529,6 +529,9 @@ static int inet6_netconf_msgsize_devconf(int type)
if (all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN)
size += nla_total_size(4);

+ if (all || type == NETCONFA_FORCE_FORWARDING)
+ size += nla_total_size(4);
+
return size;
}

@@ -578,6 +581,11 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
READ_ONCE(devconf->ignore_routes_with_linkdown)) < 0)
goto nla_put_failure;

+ if ((all || type == NETCONFA_FORCE_FORWARDING) &&
+ nla_put_s32(skb, NETCONFA_FORCE_FORWARDING,
+ READ_ONCE(devconf->force_forwarding)) < 0)
+ goto nla_put_failure;
+
out:
nlmsg_end(skb, nlh);
return 0;

---
base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main
change-id: 20261023-ipv6_add_netconfa-b87b66b35272

Best regards,
--
Gabriel Goller <g.goller@xxxxxxxxxxx>