From: Yu Watanabe Date: Sun, 5 Sep 2021 08:14:36 +0000 (+0900) Subject: network: do not try to drop addresses or routes of unmanaged interfaces on carrier... X-Git-Tag: v250-rc1~698^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1c22cf4dad5fa960bd8a63b297c3b9bfa7b363e;p=thirdparty%2Fsystemd.git network: do not try to drop addresses or routes of unmanaged interfaces on carrier lost Currently, link_stop_engines(), link_drop_config(), and link_drop_foreign_config() do nothing when the interface is unmanaged. So this does not change anything. But returning earlier should be clear and safer for protecting configs on unmanaged interfaces. --- diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 4afd540d201..a7414b2a5d0 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1617,7 +1617,10 @@ static int link_carrier_lost(Link *link) { /* let's shortcut things for CAN which doesn't need most of what's done below. */ return 0; - if (link->network && link->network->ignore_carrier_loss) + if (!link->network) + return 0; + + if (link->network->ignore_carrier_loss) return 0; r = link_stop_engines(link, false);