diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-28 11:15:01 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-03-11 14:20:31 +0900 |
commit | a48ffe47cf1db98694d2013bf97f62f55e4c3d27 (patch) | |
tree | bae936eb55730ff47891f0141a407ca0a31a21b6 /src/network | |
parent | e51928640720bb9e1464203ab50625afe6a7523f (diff) | |
download | systemd-a48ffe47cf1db98694d2013bf97f62f55e4c3d27.tar.gz |
network: refuse to configure link properties when in initialized state
The condition should be satisfied only when users request to reconfigure
the link, and in that case, all request will be cancelled. Hence, it is
not necessary to process the request.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-setlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c index a3b52dc8d2..47dc6720ac 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -486,7 +486,7 @@ static int link_is_ready_to_set_link(Link *link, Request *req) { op = PTR_TO_INT(req->set_link_operation_ptr); - if (!IN_SET(link->state, LINK_STATE_INITIALIZED, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) + if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) return false; switch (op) { @@ -1017,7 +1017,7 @@ static int link_up_or_down(Link *link, bool up, Request *req) { static bool link_is_ready_to_activate(Link *link) { assert(link); - if (!IN_SET(link->state, LINK_STATE_INITIALIZED, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) + if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) return false; if (link->set_link_messages > 0) |