From 4902ba2999dec02e82066d70ab6096b852a33007 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 2 Nov 2015 11:16:12 +0100 Subject: device: Don't process link events anymore in device user specific callback handlers Set link_state for all device types via the device_set_link API as all devices are registered in the device tree list making it possible to always get the device via device_get. The decice link state parameter will now actually reflect the corresponding kernel device carrier state in all cases. Before this change a vlan/macvlan device could still have link_state enabled if an interface was brought down; this was the case when the parent vlan/macvlan device was still enabled as the netlink link_state event would be dropped for vlan/macvlan devices due to keep_link_state in the function cb_rtnl_event. Signed-off-by: Hans Dedecker --- system-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system-linux.c') diff --git a/system-linux.c b/system-linux.c index 611acb8..4ccc9d2 100644 --- a/system-linux.c +++ b/system-linux.c @@ -424,7 +424,7 @@ static int cb_rtnl_event(struct nl_msg *msg, void *arg) goto out; struct device *dev = device_get(nla_data(nla[IFLA_IFNAME]), false); - if (!dev || dev->type->keep_link_status) + if (!dev) goto out; if (!system_get_dev_sysctl("/sys/class/net/%s/carrier", dev->ifname, buf, sizeof(buf))) -- cgit v1.2.3