From: Fernando Fernandez Mancera <fmancera@suse.de>
To: netdev@vger.kernel.org
Cc: nicolas.dichtel@6wind.com, shemminger@vyatta.com,
dforster@brocade.com, gospo@cumulusnetworks.com,
ddutt@cumulusnetworks.com, brian.haley@hp.com, horms@kernel.org,
pabeni@redhat.com, kuba@kernel.org, edumazet@google.com,
davem@davemloft.net, idosch@nvidia.com, dsahern@kernel.org,
Fernando Fernandez Mancera <fmancera@suse.de>
Subject: [PATCH net 6/6] ipv6: fix missing notification for ignore_routes_with_linkdown
Date: Thu, 18 Jun 2026 18:22:25 +0200 [thread overview]
Message-ID: <20260618162225.4588-7-fmancera@suse.de> (raw)
In-Reply-To: <20260618162225.4588-1-fmancera@suse.de>
When changing the ignore_routes_with_linkdown sysctl for a specific
interface, the RTM_NEWNETCONF netlink notification was not being emitted
to userspace. Fix this by emitting the notification when needed.
In addition, fix bogus return value for successful "all" and specific
interface write operation leading to a wrong reset of the position
pointer.
Fixes: 35103d11173b ("net: ipv6 sysctl option to ignore routes when nexthop link is down")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
net/ipv6/addrconf.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1cfb223476bd..2d81569b692b 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -955,11 +955,7 @@ static int addrconf_fixup_linkdown(const struct ctl_table *table, int *p, int ne
NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
NETCONFA_IFINDEX_DEFAULT,
net->ipv6.devconf_dflt);
- rtnl_net_unlock(net);
- return 0;
- }
-
- if (p == &net->ipv6.devconf_all->ignore_routes_with_linkdown) {
+ } else if (p == &net->ipv6.devconf_all->ignore_routes_with_linkdown) {
WRITE_ONCE(net->ipv6.devconf_dflt->ignore_routes_with_linkdown, newf);
addrconf_linkdown_change(net, newf);
if ((!newf) ^ (!old))
@@ -968,11 +964,21 @@ static int addrconf_fixup_linkdown(const struct ctl_table *table, int *p, int ne
NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
NETCONFA_IFINDEX_ALL,
net->ipv6.devconf_all);
+ } else {
+ if (!newf ^ !old) {
+ struct inet6_dev *idev = table->extra1;
+
+ inet6_netconf_notify_devconf(net,
+ RTM_NEWNETCONF,
+ NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
+ idev->dev->ifindex,
+ &idev->cnf);
+ }
}
rtnl_net_unlock(net);
- return 1;
+ return 0;
}
#endif
--
2.54.0
prev parent reply other threads:[~2026-06-18 16:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 16:22 [PATCH net 0/6] ipv6: fix sysctl error handling and missing notifications Fernando Fernandez Mancera
2026-06-18 16:22 ` [PATCH net 1/6] ipv6: fix error handling in disable_ipv6 sysctl Fernando Fernandez Mancera
2026-06-18 16:22 ` [PATCH net 2/6] ipv6: fix error handling in ignore_routes_with_linkdown sysctl Fernando Fernandez Mancera
2026-06-18 16:22 ` [PATCH net 3/6] ipv6: fix error handling in forwarding sysctl Fernando Fernandez Mancera
2026-06-18 16:22 ` [PATCH net 4/6] ipv6: fix error handling in disable_policy sysctl Fernando Fernandez Mancera
2026-06-18 16:22 ` [PATCH net 5/6] ipv6: reset value and position for proxy_ndp sysctl restart Fernando Fernandez Mancera
2026-06-18 16:22 ` Fernando Fernandez Mancera [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618162225.4588-7-fmancera@suse.de \
--to=fmancera@suse.de \
--cc=brian.haley@hp.com \
--cc=davem@davemloft.net \
--cc=ddutt@cumulusnetworks.com \
--cc=dforster@brocade.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gospo@cumulusnetworks.com \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox