diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-14 04:32:21 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-15 03:58:59 +0900 |
commit | 7149bde4bae8eaa21d6b9d355bffb3cc313d566c (patch) | |
tree | 853dddf812a80ef788fbbaea4c9bc90c278ea8a3 /src/network/networkd-setlink.c | |
parent | 1753d3021564671fba3d3196a84da657d15fb632 (diff) | |
download | systemd-7149bde4bae8eaa21d6b9d355bffb3cc313d566c.tar.gz |
network: add missing increment of Link::set_flags_messages
link_up_or_down() will decrement the counter when the subsequent
RTM_GETLINK netlink method is finished. So, we need to increment
the counter here.
Fixes the issue mentioned at
https://github.com/systemd/systemd/issues/19832#issuecomment-860255692.
Diffstat (limited to 'src/network/networkd-setlink.c')
-rw-r--r-- | src/network/networkd-setlink.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c index 478591b5bb..01a7b3139e 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -864,7 +864,16 @@ static int link_up_or_down(Link *link, bool up, link_netlink_message_handler_t c } int link_down(Link *link) { - return link_up_or_down(link, false, link_down_handler); + int r; + + assert(link); + + r = link_up_or_down(link, false, link_down_handler); + if (r < 0) + return log_link_error_errno(link, r, "Failed to bring down interface: %m"); + + link->set_flags_messages++; + return 0; } static bool link_is_ready_to_activate(Link *link) { |