diff options
Diffstat (limited to 'src/drivers/linux/tap.c')
-rw-r--r-- | src/drivers/linux/tap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/drivers/linux/tap.c b/src/drivers/linux/tap.c index ff1e08bd..c1364ddb 100644 --- a/src/drivers/linux/tap.c +++ b/src/drivers/linux/tap.c @@ -56,6 +56,10 @@ struct tap_nic { int fd; }; +/** Default MAC address */ +static const uint8_t tap_default_mac[ETH_ALEN] = + { 0x52, 0x54, 0x00, 0x12, 0x34, 0x56 }; + /** Open the TAP device */ static int tap_open(struct net_device * netdev) { @@ -202,6 +206,7 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r nic = netdev->priv; linux_set_drvdata(device, netdev); netdev->dev = &device->dev; + memcpy ( netdev->hw_addr, tap_default_mac, ETH_ALEN ); memset(nic, 0, sizeof(*nic)); /* Look for the mandatory if setting */ @@ -231,9 +236,9 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r return 0; -err_settings: unregister_netdev(netdev); err_register: +err_settings: netdev_nullify(netdev); netdev_put(netdev); return rc; |