network: refuse to configure anything on pending or initialized state
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user