X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=macvlan.c;h=051fe058960cd693410ace438c0b5423a6b58183;hb=212288ba1518c0fd4d44f22e7c2af09022944a9f;hp=e5a4891e136e0353b51c30b13b4450ba9a6e8dab;hpb=247f42d1907dbb16033dcb9a28548c4591af9d67;p=project%2Fnetifd.git diff --git a/macvlan.c b/macvlan.c index e5a4891..051fe05 100644 --- a/macvlan.c +++ b/macvlan.c @@ -140,6 +140,7 @@ macvlan_free(struct device *dev) mvdev = container_of(dev, struct macvlan_device, dev); device_remove_user(&mvdev->parent); + free(mvdev->config_data); free(mvdev); } @@ -197,6 +198,7 @@ macvlan_reload(struct device *dev, struct blob_attr *attr) 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)); @@ -226,6 +228,7 @@ macvlan_reload(struct device *dev, struct blob_attr *attr) macvlan_config_init(dev); } + free(mvdev->config_data); mvdev->config_data = attr; return ret; } @@ -258,6 +261,7 @@ 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,