mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-12 21:57:27 +03:00
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.
This commit is contained in:
parent
eac7cda211
commit
2d8950384f
@ -206,7 +206,7 @@ static int manager_rtnl_listen(Manager *m) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
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)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
@ -314,6 +314,10 @@ static int manager_network_monitor_listen(Manager *m) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
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");
|
(void) sd_event_source_set_description(m->network_event_source, "network-monitor");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user