From: Lennart Poettering Date: Tue, 26 Jan 2016 12:36:33 +0000 (+0100) Subject: resolved: prorize rtnl and sd-network event sources X-Git-Tag: v229~83^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d8950384f3137aafcce22b29912b2b61e6d86fb;p=thirdparty%2Fsystemd.git resolved: prorize rtnl and sd-network event sources Lets make sure we always take notice of network changes before answering client requests. This way, calls like SetLinkDNS() become race-free as the specified interface index is guarantee to have been processed if it exists before we make changes to it. --- diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 704f012c379..43064038349 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -206,7 +206,7 @@ static int manager_rtnl_listen(Manager *m) { if (r < 0) return r; - r = sd_netlink_attach_event(m->rtnl, m->event, 0); + r = sd_netlink_attach_event(m->rtnl, m->event, SD_EVENT_PRIORITY_IMPORTANT); if (r < 0) return r; @@ -314,6 +314,10 @@ 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); + if (r < 0) + return r; + (void) sd_event_source_set_description(m->network_event_source, "network-monitor"); return 0;