alias: Set alias link device status to disabled when device is removed
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 29 Jun 2016 12:02:18 +0000 (14:02 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 29 Jun 2016 13:37:30 +0000 (15:37 +0200)
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>
alias.c

diff --git a/alias.c b/alias.c
index 6b938ca071cb2d536f1761ac46e7c0c2ac9b2a02..56420c7be27bb33a2bb4a36c7bfe8d12f06d9cc5 100644 (file)
--- 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