1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

network: do not drop foreign config if interface is in initialized state

If the interface is in initialized state, no network file is assigned to
the interface. If an interface is not managed by networkd, previously,
the foreign configs of the interface was dropped.

Fixes #14250.
This commit is contained in:
Yu Watanabe 2019-12-05 19:54:29 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent 9929fe8c95
commit 2c7b826ddf

View File

@ -2924,7 +2924,7 @@ int link_reconfigure(Link *link, bool force) {
if (r < 0) if (r < 0)
return r; return r;
if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING)) { if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING, LINK_STATE_INITIALIZED)) {
log_link_debug(link, "State is %s, dropping config", link_state_to_string(link->state)); log_link_debug(link, "State is %s, dropping config", link_state_to_string(link->state));
r = link_drop_foreign_config(link); r = link_drop_foreign_config(link);
if (r < 0) if (r < 0)
@ -3419,7 +3419,7 @@ static int link_carrier_lost(Link *link) {
if (r < 0) if (r < 0)
return r; return r;
if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING)) { if (!IN_SET(link->state, LINK_STATE_UNMANAGED, LINK_STATE_PENDING, LINK_STATE_INITIALIZED)) {
log_link_debug(link, "State is %s, dropping config", link_state_to_string(link->state)); log_link_debug(link, "State is %s, dropping config", link_state_to_string(link->state));
r = link_drop_foreign_config(link); r = link_drop_foreign_config(link);
if (r < 0) if (r < 0)