#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"
{
struct macvlan_device *mvdev;
- D(SYSTEM, "macvlan_set_state(%s, %u)\n", dev->ifname, up);
+ D(SYSTEM, "macvlan_set_state(%s, %u)", dev->ifname, up);
mvdev = container_of(dev, struct macvlan_device, dev);
if (up)
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;