]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
wait-online: update debug log messages 19315/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Apr 2021 13:17:44 +0000 (22:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Apr 2021 13:17:44 +0000 (22:17 +0900)
src/network/wait-online/manager.c

index 8238b70464825db5e7cb02f28e0282b8915db230..e1df0345c0de3a5ed773a2659ccf493195b00063 100644 (file)
@@ -72,30 +72,30 @@ static int manager_link_is_online(Manager *m, Link *l, LinkOperationalStateRange
         needs_ipv6 = required_family & ADDRESS_FAMILY_IPV6;
 
         if (s.min >= LINK_OPERSTATE_DEGRADED) {
-                if (needs_ipv4 && l->ipv4_address_state < LINK_ADDRESS_STATE_DEGRADED)
-                        goto ipv4_not_ready;
+                if (needs_ipv4 && l->ipv4_address_state < LINK_ADDRESS_STATE_DEGRADED) {
+                        log_link_debug(l, "No routable or link-local IPv4 address is configured.");
+                        return 0;
+                }
 
-                if (needs_ipv6 && l->ipv6_address_state < LINK_ADDRESS_STATE_DEGRADED)
-                        goto ipv6_not_ready;
+                if (needs_ipv6 && l->ipv6_address_state < LINK_ADDRESS_STATE_DEGRADED) {
+                        log_link_debug(l, "No routable or link-local IPv6 address is configured.");
+                        return 0;
+                }
         }
 
         if (s.min >= LINK_OPERSTATE_ROUTABLE) {
-                if (needs_ipv4 && l->ipv4_address_state < LINK_ADDRESS_STATE_ROUTABLE)
-                        goto ipv4_not_ready;
+                if (needs_ipv4 && l->ipv4_address_state < LINK_ADDRESS_STATE_ROUTABLE) {
+                        log_link_debug(l, "No routable IPv4 address is configured.");
+                        return 0;
+                }
 
-                if (needs_ipv6 && l->ipv6_address_state < LINK_ADDRESS_STATE_ROUTABLE)
-                        goto ipv6_not_ready;
+                if (needs_ipv6 && l->ipv6_address_state < LINK_ADDRESS_STATE_ROUTABLE) {
+                        log_link_debug(l, "No routable IPv6 address is configured.");
+                        return 0;
+                }
         }
 
         return 1;
-
-ipv4_not_ready:
-        log_link_debug(l, "No routable or link-local IPv4 address is configured.");
-        return 0;
-
-ipv6_not_ready:
-        log_link_debug(l, "No routable or link-local IPv6 address is configured.");
-        return 0;
 }
 
 bool manager_configured(Manager *m) {