($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski at intel.com>
To: ell at lists.01.org
Subject: [PATCH 02/14] netconfig: Don't set prefsrc on gateway route for now
Date: Thu, 16 Jun 2022 00:47:27 +0200	[thread overview]
Message-ID: <20220615224739.1936538-2-andrew.zaborowski@intel.com> (raw)
In-Reply-To: 20220615224739.1936538-1-andrew.zaborowski@intel.com

[-- 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

                 reply	other threads:[~2022-06-15 22:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220615224739.1936538-2-andrew.zaborowski@intel.com \
    --to=ell@lists.linux.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).