#include <stdio.h>
#include <assert.h>
#include <errno.h>
-#include <net/ethernet.h>
-
-#ifdef linux
-#include <netinet/ether.h>
-#endif
#include "netifd.h"
#include "device.h"
return NULL;
dev = &mvdev->dev;
- device_init(dev, devtype, name);
+ if (device_init(dev, devtype, name) < 0) {
+ device_cleanup(dev);
+ free(mvdev);
+ return NULL;
+ }
+
dev->config_pending = true;
mvdev->set_state = dev->set_state;
return dev;
}
-struct device_type macvlan_device_type = {
- .name = "MAC VLAN",
+static struct device_type macvlan_device_type = {
+ .name = "macvlan",
.config_params = &macvlan_attr_list,
.create = macvlan_create,
.config_init = macvlan_config_init,
.free = macvlan_free,
.dump_info = macvlan_dump_info,
};
+
+static void __init macvlan_device_type_init(void)
+{
+ device_type_add(&macvlan_device_type);
+}