From 2fd3908b5c4d716b3eac450b2e529a08455d048e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 28 Jul 2022 16:43:26 +0900 Subject: [PATCH] network: drop carrier check for unmanaged interface from link_is_ready_to_configure() Preparation for later commits. No functional change. --- src/network/networkd-link.c | 8 ++------ src/network/networkd-route.c | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 7a5bc62415..8d4e64769b 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -98,12 +98,8 @@ bool link_is_ready_to_configure(Link *link, bool allow_unmanaged) { if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED, LINK_STATE_UNMANAGED)) return false; - if (!link->network) { - if (!allow_unmanaged) - return false; - - return link_has_carrier(link); - } + if (!link->network) + return allow_unmanaged; if (!link->network->configure_without_carrier) { if (link->set_flags_messages > 0) diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 921b031b29..71e578d898 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1298,7 +1298,8 @@ static int route_is_ready_to_configure(const Route *route, Link *link) { if (r < 0) return false; if (r > 0) { - if (!link_is_ready_to_configure(l, true)) + if (!link_is_ready_to_configure(l, /* allow_unmanaged = */ true) || + !link_has_carrier(l)) return false; m->ifindex = l->ifindex;