Embedded Linux Library
 help / color / mirror / Atom feed
From: Ryan Walklin <ryan@testtoast.com>
To: ell@lists.linux.dev
Cc: Ryan Walklin <ryan@testtoast.com>
Subject: [PATCH 3/6] netconfig: Expire RA routes never refreshed
Date: Tue, 17 Nov 2026 11:27:49 +1300	[thread overview]
Message-ID: <20261116222756.2921577-4-ryan@testtoast.com> (raw)
In-Reply-To: <20261116222756.2921577-1-ryan@testtoast.com>

rd->kernel_expiry is only set when an existing route is updated, so a
route that's added and never appears in another RA, e.g. because the
router went away, keeps kernel_expiry at 0 and is never expired by
netconfig_check_route_expired().  The kernel deletes it when its
lifetime ends but it stays on the current list, counts towards
max_icmp6_routes and is reported as removed on unconfigure.

Set kernel_expiry for routes on the added list too, since those are
committed with the lifetime from the latest RA.

Fixes: 6eb8b8bccdcb ("netconfig: Ratelimit route lifetime updates")
---
 ell/netconfig.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/ell/netconfig.c b/ell/netconfig.c
index 1be26ad..7e20de6 100644
--- a/ell/netconfig.c
+++ b/ell/netconfig.c
@@ -1127,8 +1127,14 @@ static void netconfig_set_icmp6_route_data(struct l_netconfig *nc,
 							expiry, old_expiry);
 	}
 
-	if (updated && differs && !netconfig_route_exists(nc->routes.added,
-								rd->route)) {
+	/*
+	 * A route on the added list will be committed with the current
+	 * lifetime, whether it's new or was updated again before the user
+	 * got to it, so it expires in the kernel at the current expiry time.
+	 */
+	if (netconfig_route_exists(nc->routes.added, rd->route))
+		rd->kernel_expiry = expiry;
+	else if (updated && differs) {
 		l_queue_push_tail(nc->routes.updated, rd->route);
 		rd->kernel_expiry = expiry;
 	}
-- 
2.55.0


  parent reply	other threads:[~2026-11-16 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 22:27 [PATCH 0/6] netconfig: RA route, SLAAC lifetime and DNS fixes Ryan Walklin
2026-11-16 22:27 ` [PATCH 1/6] netconfig: Allocate the expired lists Ryan Walklin
2026-11-16 22:27 ` [PATCH 2/6] netconfig: Fix leak of RA route data Ryan Walklin
2026-11-16 22:27 ` Ryan Walklin [this message]
2026-11-16 22:27 ` [PATCH 4/6] netconfig: Fix the RFC 4862 2-hour rule Ryan Walklin
2026-11-16 22:27 ` [PATCH 5/6] netconfig: Skip duplicate DNS servers and domains Ryan Walklin
2026-11-16 22:27 ` [PATCH 6/6] icmp6: Fix RA leak when stopped from a handler Ryan Walklin

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=20261116222756.2921577-4-ryan@testtoast.com \
    --to=ryan@testtoast.com \
    --cc=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