All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 02/14] netconfig: Don't set prefsrc on gateway route for now
@ 2022-06-15 22:47 Andrew Zaborowski
  0 siblings, 0 replies; only message in thread
From: Andrew Zaborowski @ 2022-06-15 22:47 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

Avoid setting the prefsrc attribute on our gateway route until we have
at least a better handling of DAD on the IPv6 addresses, either by
leveraging the kernel implementation or adding our own.  The kernel
won't allow us to add a route with prefsrc containing a local address
that has been basically just added with RTM_NEWADDR because DAD would
still be running and if it works it's by luck.  We'll need to add those
routes asynchronously after the address has been confirmed.
---
 ell/netconfig.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ell/netconfig.c b/ell/netconfig.c
index 5de5d74..c7251c2 100644
--- a/ell/netconfig.c
+++ b/ell/netconfig.c
@@ -235,7 +235,17 @@ static void netconfig_add_v6_static_routes(struct l_netconfig *nc,
 
 	v6_default_route = l_rtnl_route_new_gateway(nc->v6_gateway_override);
 	l_rtnl_route_set_protocol(v6_default_route, RTPROT_STATIC);
-	L_WARN_ON(!l_rtnl_route_set_prefsrc(v6_default_route, ip));
+	/*
+	 * TODO: Optimally we'd set the prefsrc on the route with:
+	 * L_WARN_ON(!l_rtnl_route_set_prefsrc(v6_default_route, ip));
+	 *
+	 * but that means that we can only commit the route to the kernel
+	 * with an RTM_NEWROUTE command after the corresponding RTM_NEWADDR
+	 * has returned and the kernel has finished DAD for the address and
+	 * cleared IFA_F_TENTATIVE.  That will complicate
+	 * l_netconfig_apply_rtnl() significantly but may be inevitable.
+	 */
+
 	l_queue_push_tail(nc->routes.current, v6_default_route);
 	l_queue_push_tail(nc->routes.added, v6_default_route);
 }
-- 
2.34.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-15 22:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 22:47 [PATCH 02/14] netconfig: Don't set prefsrc on gateway route for now Andrew Zaborowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.