diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-01-15 22:42:30 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-01-15 22:42:30 +0000 |
commit | 2dcef4b7a11a780a684a69021a0c91bc43e03883 (patch) | |
tree | 7e9e1596ad625b530d29da7a2076de1d121251f4 /src | |
parent | f07630c74f3d67906baf820f080b5d0e5ad49ca4 (diff) | |
download | ipxe-2dcef4b7a11a780a684a69021a0c91bc43e03883.zip ipxe-2dcef4b7a11a780a684a69021a0c91bc43e03883.tar.gz ipxe-2dcef4b7a11a780a684a69021a0c91bc43e03883.tar.bz2 |
[efi] Create VLAN autoboot device automaticallyautovlan
When chainloading iPXE from an EFI VLAN device, configure the
corresponding iPXE VLAN device to be created automatically.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/interface/efi/efi_autoboot.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/interface/efi/efi_autoboot.c b/src/interface/efi/efi_autoboot.c index ec7793c..a103c2f 100644 --- a/src/interface/efi/efi_autoboot.c +++ b/src/interface/efi/efi_autoboot.c @@ -25,6 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <string.h> #include <errno.h> +#include <ipxe/if_ether.h> +#include <ipxe/vlan.h> #include <ipxe/efi/efi.h> #include <ipxe/efi/efi_path.h> #include <ipxe/efi/efi_autoboot.h> @@ -81,6 +83,13 @@ int efi_set_autoboot_ll_addr ( EFI_HANDLE device, efi_handle_name ( device ), vlan ); } + /* Configure automatic VLAN device, if applicable */ + if ( vlan && ( mode->HwAddressSize == ETH_ALEN ) ) { + vlan_auto ( &mode->CurrentAddress, vlan ); + DBGC ( device, "EFI %s configured automatic VLAN %d\n", + efi_handle_name ( device ), vlan ); + } + /* Close protocol */ bs->CloseProtocol ( device, &efi_simple_network_protocol_guid, efi_image_handle, NULL ); |