]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: process networkd events before RTNL updates
authorelysia090 <148540043+elysia090@users.noreply.github.com>
Mon, 1 Jun 2026 03:29:58 +0000 (12:29 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 2 Jun 2026 08:30:53 +0000 (09:30 +0100)
resolved watches networkd state changes and RTNL updates separately. RTNL is
currently processed at SD_EVENT_PRIORITY_IMPORTANT, while networkd state
changes are processed later at SD_EVENT_PRIORITY_IMPORTANT+5.

If both are pending, an RTM_NEWADDR update can make a link relevant for
LLMNR/mDNS scope allocation before resolved has consumed the corresponding
networkd state update. This can let scope recalculation use stale per-link
settings until the networkd event is processed.

Run the networkd monitor source before RTNL by using
SD_EVENT_PRIORITY_IMPORTANT-5. This lets resolved consume current link settings
before reacting to RTNL address updates in the same event loop iteration.

Fixes #42079
Co-developed-by: OpenAI Codex <noreply@openai.com>
src/resolve/resolved-manager.c

index add4f64910507c49b18fcaef70596d736efde66b..29a7046be3e4a1152452cba31776d9fa7dccf426 100644 (file)
@@ -369,7 +369,7 @@ static int manager_network_monitor_listen(Manager *m) {
         if (r < 0)
                 return r;
 
-        r = sd_event_source_set_priority(m->network_event_source, SD_EVENT_PRIORITY_IMPORTANT+5);
+        r = sd_event_source_set_priority(m->network_event_source, SD_EVENT_PRIORITY_IMPORTANT-5);
         if (r < 0)
                 return r;