diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-01-14 00:31:54 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-01-15 00:42:52 +0000 |
commit | c4c03e5be867a9b7be4dc48fe6576deca1dce8d8 (patch) | |
tree | 58243f0e5ae2b1907f7291de19de9416b288a565 /src/net | |
parent | 47af48012e2afaaf56108466fb967009670660bb (diff) | |
download | ipxe-c4c03e5be867a9b7be4dc48fe6576deca1dce8d8.tar.gz |
[netdevice] Allow duplicate MAC addresses
Many laptops now include the ability to specify a "system-specific MAC
address" (also known as "pass-through MAC"), which is supposed to be
used for both the onboard NIC and for any attached docking station or
other USB NIC. This is intended to simplify interoperability with
software or hardware that relies on a MAC address to recognise an
individual machine: for example, a deployment server may associate the
MAC address with a particular operating system image to be deployed.
This therefore creates legitimate situations in which duplicate MAC
addresses may exist within the same system.
As described in commit 98d09a1 ("[netdevice] Avoid registering
duplicate network devices"), the Xen netfront driver relies on the
rejection of duplicate MAC addresses in order to inhibit registration
of the emulated PCI devices that a Xen PV-HVM guest will create to
shadow each of the paravirtual network devices.
Move the code that rejects duplicate MAC addresses from the network
device core to the Xen netfront driver, to allow for the existence of
duplicate MAC addresses in non-Xen setups.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/netdevice.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/net/netdevice.c b/src/net/netdevice.c index 597c62285..07961bf20 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -735,18 +735,6 @@ int register_netdev ( struct net_device *netdev ) { ll_protocol->ll_header_len ); } - /* Reject network devices that are already available via a - * different hardware device. - */ - duplicate = find_netdev_by_ll_addr ( ll_protocol, netdev->ll_addr ); - if ( duplicate && ( duplicate->dev != netdev->dev ) ) { - DBGC ( netdev, "NETDEV rejecting duplicate (phys %s) of %s " - "(phys %s)\n", netdev->dev->name, duplicate->name, - duplicate->dev->name ); - rc = -EEXIST; - goto err_duplicate; - } - /* Reject named network devices that already exist */ if ( netdev->name[0] && ( duplicate = find_netdev ( netdev->name ) ) ) { DBGC ( netdev, "NETDEV rejecting duplicate name %s\n", @@ -1003,27 +991,6 @@ struct net_device * find_netdev_by_location ( unsigned int bus_type, } /** - * Get network device by link-layer address - * - * @v ll_protocol Link-layer protocol - * @v ll_addr Link-layer address - * @ret netdev Network device, or NULL - */ -struct net_device * find_netdev_by_ll_addr ( struct ll_protocol *ll_protocol, - const void *ll_addr ) { - struct net_device *netdev; - - list_for_each_entry ( netdev, &net_devices, list ) { - if ( ( netdev->ll_protocol == ll_protocol ) && - ( memcmp ( netdev->ll_addr, ll_addr, - ll_protocol->ll_addr_len ) == 0 ) ) - return netdev; - } - - return NULL; -} - -/** * Get most recently opened network device * * @ret netdev Most recently opened network device, or NULL |