summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-11-14 11:51:58 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-11-14 11:52:49 +0900
commitb7ac12843020201b2792378ae4af7580e75015ea (patch)
treeebbc35a4b992dc52332dc68861d481de48ffdc16
parent52c3bc708fb6a3eb68a3cac780b49192818bd409 (diff)
downloadsystemd-b7ac12843020201b2792378ae4af7580e75015ea.tar.gz
network: do not recall link_handle_bound_by_list() or so when the interface is reconfigured
-rw-r--r--src/network/networkd-link.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 5136a8820e..62c06af122 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1584,6 +1584,16 @@ static int link_carrier_gained(Link *link) {
assert(link);
+ if (IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) {
+ /* 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 = */ false);
+ if (r != 0)
+ return r;
+ }
+
r = link_handle_bound_by_list(link);
if (r < 0)
return r;
@@ -1957,15 +1967,6 @@ static int link_update_flags(Link *link, sd_netlink_message *message) {
if (!had_carrier && link_has_carrier(link)) {
log_link_info(link, "Gained carrier");
- if (IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) {
- /* 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(). */
- r = link_reconfigure_impl(link, /* force = */ false);
- if (r < 0)
- return r;
- }
-
r = link_carrier_gained(link);
if (r < 0)
return r;