summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-06-29 14:02:18 +0200
committerJo-Philipp Wich <jo@mein.io>2016-06-29 15:37:30 +0200
commit5df548d8edd3f9be39d409d1eeeaef99fbb27aa0 (patch)
tree8a36614c1c99e774b52fbcd45ec0c1613ae3bb93
parent99e6dc68bbac5a57a0ebca810a9dc36e38667821 (diff)
alias: Set alias link device status to disabled when device is removed
Fixes missing link state event propagation for an aliased device in case a new device is added as the link state has the last known status of the old device possible resulting into no link state change detection. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Acked-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--alias.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/alias.c b/alias.c
index 6b938ca..56420c7 100644
--- a/alias.c
+++ b/alias.c
@@ -61,8 +61,10 @@ static void alias_set_device(struct alias_device *alias, struct device *dev)
device_set_ifindex(&alias->dev, dev->ifindex);
device_set_ifname(&alias->dev, dev->ifname);
device_add_user(&alias->dep, dev);
- } else
+ } else {
device_set_ifname(&alias->dev, "");
+ device_set_link(&alias->dev, false);
+ }
}
static int