]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: drop redundant condition
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Oct 2022 01:44:06 +0000 (10:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Oct 2022 19:55:20 +0000 (04:55 +0900)
The function `link_reconfigure_impl()` has the same condition at the
beginning.

src/network/networkd-link.c

index 00e4e451ef3ceb695f1c1266156c9700ecdde725..e901c62fbff9b065400a522dae212105513ad8cd 100644 (file)
@@ -1537,15 +1537,12 @@ static int link_carrier_gained(Link *link) {
         force_reconfigure = link->previous_ssid && !streq_ptr(link->previous_ssid, link->ssid);
         link->previous_ssid = mfree(link->previous_ssid);
 
-        if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_FAILED, LINK_STATE_LINGER)) {
-                /* At this stage, both wlan and link information should be up-to-date. Hence,
-                 * it is not necessary to call RTM_GETLINK, NL80211_CMD_GET_INTERFACE, or
-                 * NL80211_CMD_GET_STATION commands, and simply call link_reconfigure_impl().
-                 * Note, link_reconfigure_impl() returns 1 when the link is reconfigured. */
-                r = link_reconfigure_impl(link, force_reconfigure);
-                if (r != 0)
-                        return r;
-        }
+        /* At this stage, both wlan and link information should be up-to-date. Hence, it is not necessary to
+         * call RTM_GETLINK, NL80211_CMD_GET_INTERFACE, or NL80211_CMD_GET_STATION commands, and simply call
+         * link_reconfigure_impl(). Note, link_reconfigure_impl() returns 1 when the link is reconfigured. */
+        r = link_reconfigure_impl(link, force_reconfigure);
+        if (r != 0)
+                return r;
 
         r = link_handle_bound_by_list(link);
         if (r < 0)