From: Yu Watanabe Date: Thu, 20 Jan 2022 21:15:31 +0000 (+0900) Subject: wait-online: use network_link_get_operational_state() X-Git-Tag: v251-rc1~486^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a4152f02b0c8c80e99a4b43745db1e96a793c50;p=thirdparty%2Fsystemd.git wait-online: use network_link_get_operational_state() --- diff --git a/src/network/wait-online/link.c b/src/network/wait-online/link.c index 5a33d563c24..a1ad16db478 100644 --- a/src/network/wait-online/link.c +++ b/src/network/wait-online/link.c @@ -97,7 +97,7 @@ int link_update_rtnl(Link *l, sd_netlink_message *m) { } int link_update_monitor(Link *l) { - _cleanup_free_ char *operstate = NULL, *required_operstate = NULL, *required_family = NULL, + _cleanup_free_ char *required_operstate = NULL, *required_family = NULL, *ipv4_address_state = NULL, *ipv6_address_state = NULL, *state = NULL; int r, ret = 0; @@ -123,18 +123,9 @@ int link_update_monitor(Link *l) { "Failed to parse required operational state, ignoring: %m"); } - r = sd_network_link_get_operational_state(l->ifindex, &operstate); + r = network_link_get_operational_state(l->ifindex, &l->operational_state); if (r < 0) ret = log_link_debug_errno(l, r, "Failed to get operational state, ignoring: %m"); - else { - LinkOperationalState s; - - s = link_operstate_from_string(operstate); - if (s < 0) - ret = log_link_debug_errno(l, s, "Failed to parse operational state, ignoring: %m"); - else - l->operational_state = s; - } r = sd_network_link_get_required_family_for_online(l->ifindex, &required_family); if (r < 0)