summaryrefslogtreecommitdiffstats
path: root/src/drivers/linux
diff options
context:
space:
mode:
authorSimon Rettberg2023-10-06 18:37:21 +0200
committerSimon Rettberg2023-10-06 18:37:21 +0200
commit95a57769874a70456670984debc05084feb75f6b (patch)
tree9943c86b682e1b1d21a0439637b3849840a50137 /src/drivers/linux
parent[efi] Remove old RDRAND hack; now officially supported (diff)
parent[libc] Use wall clock time as seed for the (non-cryptographic) RNG (diff)
downloadipxe-95a57769874a70456670984debc05084feb75f6b.tar.gz
ipxe-95a57769874a70456670984debc05084feb75f6b.tar.xz
ipxe-95a57769874a70456670984debc05084feb75f6b.zip
Merge branch 'master' into openslx
Diffstat (limited to 'src/drivers/linux')
-rw-r--r--src/drivers/linux/af_packet.c2
-rw-r--r--src/drivers/linux/tap.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/drivers/linux/af_packet.c b/src/drivers/linux/af_packet.c
index 9fa6ef2a5..980bd4626 100644
--- a/src/drivers/linux/af_packet.c
+++ b/src/drivers/linux/af_packet.c
@@ -300,9 +300,9 @@ static int af_packet_nic_probe ( struct linux_device *device,
return 0;
-err_settings:
unregister_netdev(netdev);
err_register:
+err_settings:
netdev_nullify(netdev);
netdev_put(netdev);
return rc;
diff --git a/src/drivers/linux/tap.c b/src/drivers/linux/tap.c
index ff1e08bdb..c1364ddb5 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;