diff options
author | Susant Sahani <ssahani@users.noreply.github.com> | 2016-04-21 19:38:07 +0530 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-04-21 16:08:07 +0200 |
commit | 0c241a378d9fdb0a1f462829e1e2ba9e8b036c06 (patch) | |
tree | 5b75123c8c339848ed5f6a73f581e12396153df2 /src/network/networkd-link.c | |
parent | 52b9b66b7d7045a0b0a25150dc8ee0c7b815e414 (diff) |
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.
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r-- | src/network/networkd-link.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 0fb3aa6c43..5cdf123652 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -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); |