]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
wait-online: use network_link_get_operational_state()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Jan 2022 21:15:31 +0000 (06:15 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Jan 2022 21:22:39 +0000 (06:22 +0900)
src/network/wait-online/link.c

index 5a33d563c240537eac7acf7ee760320fe7077a77..a1ad16db47892e7776d23410a8aaf57591242f68 100644 (file)
@@ -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)