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 --- macvlan.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'macvlan.c') diff --git a/macvlan.c b/macvlan.c index 051fe05..a0f11ae 100644 --- a/macvlan.c +++ b/macvlan.c @@ -72,12 +72,6 @@ macvlan_base_cb(struct device_user *dev, enum device_event ev) case DEV_EVENT_REMOVE: device_set_present(&mvdev->dev, false); break; - case DEV_EVENT_LINK_UP: - device_set_link(&mvdev->dev, true); - break; - case DEV_EVENT_LINK_DOWN: - device_set_link(&mvdev->dev, false); - break; default: return; } @@ -261,8 +255,6 @@ macvlan_create(const char *name, struct blob_attr *attr) const struct device_type macvlan_device_type = { .name = "MAC VLAN", .config_params = &macvlan_attr_list, - .keep_link_status = true, - .create = macvlan_create, .config_init = macvlan_config_init, .reload = macvlan_reload, -- cgit v1.2.1