summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2015-11-25 08:46:43 +0100
committerChristian Hesse <mail@eworm.de>2015-11-25 20:02:53 +0100
commite5d44b34cca39a335b8976328a14f47e2d7ef3b9 (patch)
treea64cf2ee6920721c67b92b4ffeea31ffa0146977 /src
parentaf143e3b692fbba2e68efd2c834711ba518f547a (diff)
networkd: link - do not drop config for loopback device
Commit 5e5b137a (networkd: link - drop foreign config when configuring link) introduced a regression where addresses (including 127.0.0.1) are removed from loopback device. Do not handle loopback device when removing foreign configs. Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 64a4b74e15..a9d91b07f6 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2040,9 +2040,13 @@ static int link_configure(Link *link) {
assert(link->network);
assert(link->state == LINK_STATE_PENDING);
- r = link_drop_foreign_config(link);
- if (r < 0)
- return r;
+ /* Drop foreign config, but ignore loopback device.
+ * We do not want to remove loopback address. */
+ if (!(link->flags & IFF_LOOPBACK)) {
+ r = link_drop_foreign_config(link);
+ if (r < 0)
+ return r;
+ }
r = link_set_bridge_fdb(link);
if (r < 0)