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 --- vlan.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'vlan.c') diff --git a/vlan.c b/vlan.c index 3d0a4cf..8e7141f 100644 --- a/vlan.c +++ b/vlan.c @@ -79,11 +79,6 @@ static void vlan_dev_cb(struct device_user *dep, enum device_event ev) case DEV_EVENT_REMOVE: device_set_present(&vldev->dev, new_state); break; - case DEV_EVENT_LINK_UP: - new_state = true; - case DEV_EVENT_LINK_DOWN: - device_set_link(&vldev->dev, new_state); - break; case DEV_EVENT_UPDATE_IFNAME: vlan_dev_set_name(vldev, dep->dev); device_broadcast_event(&vldev->dev, ev); @@ -102,7 +97,6 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create) static const struct device_type vlan_type = { .name = "VLAN", .config_params = &device_attr_list, - .keep_link_status = true, .free = free_vlan_if, }; struct vlan_device *vldev; -- cgit v1.2.3