resolved: process networkd events before RTNL updates

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>
This commit is contained in:
elysia090
2026-06-02 09:30:53 +01:00
committed by Luca Boccassi
parent 16f72b2468
commit 87b81528a8
+1 -1
View 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;