mirror of
https://github.com/systemd/systemd
synced 2024-07-22 02:34:54 +00:00
networkd: When link gets dirty mark manager dirty too (#3080)
If we not marking manager dirty when link is dirty then the state file is not updated. This is a side effect of issue 2850 setting CriticalConnection=yes timesyncd NTP servers given by DHCP server are ignored.
This commit is contained in:
parent
52b9b66b7d
commit
0c241a378d
|
@ -299,7 +299,6 @@ void link_update_operstate(Link *link) {
|
||||||
link->operstate = operstate;
|
link->operstate = operstate;
|
||||||
link_send_changed(link, "OperationalState", NULL);
|
link_send_changed(link, "OperationalState", NULL);
|
||||||
link_dirty(link);
|
link_dirty(link);
|
||||||
manager_dirty(link->manager);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3228,14 +3227,17 @@ void link_dirty(Link *link) {
|
||||||
|
|
||||||
assert(link);
|
assert(link);
|
||||||
|
|
||||||
|
/* mark manager dirty as link is dirty */
|
||||||
|
manager_dirty(link->manager);
|
||||||
|
|
||||||
r = set_ensure_allocated(&link->manager->dirty_links, NULL);
|
r = set_ensure_allocated(&link->manager->dirty_links, NULL);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
/* allocation errors are ignored */
|
/* allocation errors are ignored */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
r = set_put(link->manager->dirty_links, link);
|
r = set_put(link->manager->dirty_links, link);
|
||||||
if (r < 0)
|
if (r <= 0)
|
||||||
/* allocation errors are ignored */
|
/* don't take another ref if the link was already dirty */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
link_ref(link);
|
link_ref(link);
|
||||||
|
|
Loading…
Reference in a new issue