]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not make the implied default have the first priority
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 4 Jan 2024 16:10:56 +0000 (01:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 5 Jan 2024 09:04:18 +0000 (18:04 +0900)
Follow-up for b732606950f8726c0280080c7d055a714c2888f5 and
6706ce2fd2a13df0ae5e469b72d688eaf643dac4.

If Network.ignore_carrier_loss_set flag is set, then the timeout value
is always used, hence the logic implemented by
b732606950f8726c0280080c7d055a714c2888f5 never worked.

src/network/networkd-link.c
src/network/networkd-network.c

index 26fa8a115d48441e48baf409badd616198e18036..01817737d06e3243486ef4ff872292e163cca04f 100644 (file)
@@ -1665,7 +1665,7 @@ static int link_carrier_lost(Link *link) {
                 usec = 5 * USEC_PER_SEC;
 
         else
-                /* Otherwise, use the currently set value. */
+                /* Otherwise, use the implied default value. */
                 usec = link->network->ignore_carrier_loss_usec;
 
         if (usec == USEC_INFINITY)
index a2b3580ced134802f72c08c88fe4d91927e18a1a..7606a2a95cd86f77ba757fb71444b0155c8ffdd7 100644 (file)
@@ -274,10 +274,8 @@ int network_verify(Network *network) {
                 network->ignore_carrier_loss_usec = USEC_INFINITY;
         }
 
-        if (!network->ignore_carrier_loss_set) {
-                network->ignore_carrier_loss_set = true;
+        if (!network->ignore_carrier_loss_set) /* Set implied default. */
                 network->ignore_carrier_loss_usec = network->configure_without_carrier ? USEC_INFINITY : 0;
-        }
 
         if (IN_SET(network->activation_policy, ACTIVATION_POLICY_DOWN, ACTIVATION_POLICY_ALWAYS_DOWN, ACTIVATION_POLICY_MANUAL)) {
                 if (network->required_for_online < 0 ||