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.
This commit is contained in:
Yu Watanabe
2022-03-11 14:20:31 +09:00
parent e519286407
commit a48ffe47cf
+2 -2
View File
@@ -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)