X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=macvlan.c;h=e5a4891e136e0353b51c30b13b4450ba9a6e8dab;hp=f42f3e5a27dbfc1f329580b9d26bdc0cfd0b8c6e;hb=247f42d1907dbb16033dcb9a28548c4591af9d67;hpb=7a3cfc37189aab8991cfaa7986f221d61127599d diff --git a/macvlan.c b/macvlan.c index f42f3e5..e5a4891 100644 --- a/macvlan.c +++ b/macvlan.c @@ -19,6 +19,10 @@ #include #include +#ifdef linux +#include +#endif + #include "netifd.h" #include "device.h" #include "interface.h" @@ -40,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 { @@ -65,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; }