From 1a4152f02b0c8c80e99a4b43745db1e96a793c50 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 21 Jan 2022 06:15:31 +0900 Subject: [PATCH] wait-online: use network_link_get_operational_state() --- src/network/wait-online/link.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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) -- 2.47.3