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:
Susant Sahani 2016-04-21 19:38:07 +05:30 committed by Martin Pitt
parent 52b9b66b7d
commit 0c241a378d
1 changed files with 5 additions and 3 deletions

View File

@ -299,7 +299,6 @@ void link_update_operstate(Link *link) {
link->operstate = operstate;
link_send_changed(link, "OperationalState", NULL);
link_dirty(link);
manager_dirty(link->manager);
}
}
@ -3228,14 +3227,17 @@ void link_dirty(Link *link) {
assert(link);
/* mark manager dirty as link is dirty */
manager_dirty(link->manager);
r = set_ensure_allocated(&link->manager->dirty_links, NULL);
if (r < 0)
/* allocation errors are ignored */
return;
r = set_put(link->manager->dirty_links, link);
if (r < 0)
/* allocation errors are ignored */
if (r <= 0)
/* don't take another ref if the link was already dirty */
return;
link_ref(link);