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.
}
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) {