summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-09 12:11:15 +0200
committerTom Gundersen <teg@jklm.no>2014-05-09 14:41:27 +0200
commit7619683b46bddcf753786fd20581322da9825f99 (patch)
tree5b853d3267444fb91f36b0d90f7ab057e746bd7a /src
parentd9c67ea112724e271c39553d966eae612e272e34 (diff)
networkd: link - handle links coming back to life
When enslaving devices, we may receieve DELLINK/NEWLINK for the same ifindex, let's not be confused by this.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 7cb9ee6754..d23be9ccbf 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -160,7 +160,7 @@ void link_drop(Link *link) {
link->state = LINK_STATE_LINGER;
- log_debug_link(link, "dropped");
+ log_debug_link(link, "link removed");
link_unref(link);
@@ -1733,6 +1733,12 @@ int link_update(Link *link, sd_rtnl_message *m) {
assert(link->ifname);
assert(m);
+ if (link->state == LINK_STATE_LINGER) {
+ link_ref(link);
+ log_info_link(link, "link readded");
+ link->state = LINK_STATE_ENSLAVING;
+ }
+
r = sd_rtnl_message_read_string(m, IFLA_IFNAME, &ifname);
if (r >= 0 && !streq(ifname, link->ifname)) {
log_info_link(link, "renamed to %s", ifname);