networkd: link - do not drop config for critical interfaces

the idea is that interfaces marked as critical are typically used
for NFS root. networkd shouldn't drop that config.

discussion at #780
This commit is contained in:
Damjan Georgievski 2016-01-04 22:04:17 +01:00
parent d7a2f11bb9
commit 02e2862194

View file

@ -2039,9 +2039,9 @@ static int link_configure(Link *link) {
assert(link->network);
assert(link->state == LINK_STATE_PENDING);
/* Drop foreign config, but ignore loopback device.
* We do not want to remove loopback address. */
if (!(link->flags & IFF_LOOPBACK)) {
/* Drop foreign config, but ignore loopback or critical devices.
* We do not want to remove loopback address or addresses used for root NFS. */
if (!(link->flags & IFF_LOOPBACK) && !(link->network->dhcp_critical)) {
r = link_drop_foreign_config(link);
if (r < 0)
return r;