[OpenWrt-Devel] [PATCH netifd] alias: Set alias link device status to disabled when device is removed

Hans Dedecker dedeckeh at gmail.com
Wed Jun 29 08:02:18 EDT 2016


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 at gmail.com>
---
 alias.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list