summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-05-10 18:54:48 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-08-05 14:49:27 +0200
commitd8d4db58ca6c76cae06362a56359f77481c4271d (patch)
treef80ee67de2eaf27ad765575a65f7fe383c50f034 /src/network/networkd-link.c
parentnetwork: unset master ifindex only when necessary (diff)
downloadsystemd-d8d4db58ca6c76cae06362a56359f77481c4271d.tar.xz
systemd-d8d4db58ca6c76cae06362a56359f77481c4271d.zip
network: refuse to configure anything on pending or initialized state
Diffstat (limited to '')
-rw-r--r--src/network/networkd-link.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 76e0690aef..7a5bc62415 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -95,6 +95,9 @@ bool link_ipv6_enabled(Link *link) {
bool link_is_ready_to_configure(Link *link, bool allow_unmanaged) {
assert(link);
+ if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED, LINK_STATE_UNMANAGED))
+ return false;
+
if (!link->network) {
if (!allow_unmanaged)
return false;
@@ -102,9 +105,6 @@ bool link_is_ready_to_configure(Link *link, bool allow_unmanaged) {
return link_has_carrier(link);
}
- if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
- return false;
-
if (!link->network->configure_without_carrier) {
if (link->set_flags_messages > 0)
return false;