X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=macvlan.c;h=019a7ffedce6db4f353f38c19275fcceb9ed0f09;hp=28567dc876025c953645b6f87f8895b2e1913156;hb=fb2f843edf44c6f12b636cd82cdd1c71e953495f;hpb=2851c3bcde8c23f6535b13c80fc486569c288ec7 diff --git a/macvlan.c b/macvlan.c index 28567dc..019a7ff 100644 --- a/macvlan.c +++ b/macvlan.c @@ -44,6 +44,9 @@ static const struct blobmsg_policy macvlan_attrs[__MACVLAN_ATTR_MAX] = { static const struct uci_blob_param_list macvlan_attr_list = { .n_params = __MACVLAN_ATTR_MAX, .params = macvlan_attrs, + + .n_next = 1, + .next = { &device_attr_list }, }; struct macvlan_device { @@ -69,6 +72,12 @@ 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; } @@ -249,6 +258,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,