Skip to content

Commit a48ffe4

Browse files
committed
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.
1 parent e519286 commit a48ffe4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/network/networkd-setlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int link_is_ready_to_set_link(Link *link, Request *req) {
486486

487487
op = PTR_TO_INT(req->set_link_operation_ptr);
488488

489-
if (!IN_SET(link->state, LINK_STATE_INITIALIZED, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
489+
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
490490
return false;
491491

492492
switch (op) {
@@ -1017,7 +1017,7 @@ static int link_up_or_down(Link *link, bool up, Request *req) {
10171017
static bool link_is_ready_to_activate(Link *link) {
10181018
assert(link);
10191019

1020-
if (!IN_SET(link->state, LINK_STATE_INITIALIZED, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
1020+
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
10211021
return false;
10221022

10231023
if (link->set_link_messages > 0)

0 commit comments

Comments
 (0)