projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
alias: Set alias link device status to disabled when device is removed
[project/netifd.git]
/
macvlan.c
diff --git
a/macvlan.c
b/macvlan.c
index
019a7ff
..
a0f11ae
100644
(file)
--- 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_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;
}
default:
return;
}
@@
-140,6
+134,7
@@
macvlan_free(struct device *dev)
mvdev = container_of(dev, struct macvlan_device, dev);
device_remove_user(&mvdev->parent);
mvdev = container_of(dev, struct macvlan_device, dev);
device_remove_user(&mvdev->parent);
+ free(mvdev->config_data);
free(mvdev);
}
free(mvdev);
}
@@
-197,6
+192,7
@@
macvlan_reload(struct device *dev, struct blob_attr *attr)
struct macvlan_device *mvdev;
mvdev = container_of(dev, struct macvlan_device, dev);
struct macvlan_device *mvdev;
mvdev = container_of(dev, struct macvlan_device, dev);
+ attr = blob_memdup(attr);
blobmsg_parse(device_attr_list.params, __DEV_ATTR_MAX, tb_dev,
blob_data(attr), blob_len(attr));
blobmsg_parse(device_attr_list.params, __DEV_ATTR_MAX, tb_dev,
blob_data(attr), blob_len(attr));
@@
-226,6
+222,7
@@
macvlan_reload(struct device *dev, struct blob_attr *attr)
macvlan_config_init(dev);
}
macvlan_config_init(dev);
}
+ free(mvdev->config_data);
mvdev->config_data = attr;
return ret;
}
mvdev->config_data = attr;
return ret;
}
@@
-258,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,
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,
.create = macvlan_create,
.config_init = macvlan_config_init,
.reload = macvlan_reload,