Module Name: src Committed By: rin Date: Mon Jul 24 08:30:42 UTC 2023
Modified Files: src/sys/arch/i386/stand/efiboot: efipxe.c src/sys/stand/efiboot: efipxe.c Log Message: MI and x86 efiboot: Fix device path type for PXE boot device. It should be Messaging, not Media Device Path. Taken from OpenBSD, for which this code was originally written: https://cvsweb.openbsd.org/src/sys/arch/amd64/stand/efiboot/efipxe.c#rev1.6 > Network-based device paths use Messaging and not Media types. Thus > in reality the depth was always -1 which made the compare function > a No-Op. Properly check the device path depth value and look for > the Messaging type instead to find the correct NIC. This check > never worked before and was uncovered by the last change. > > Regression noticed by bluhm@ To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/efipxe.c cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efipxe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/i386/stand/efiboot/efipxe.c diff -u src/sys/arch/i386/stand/efiboot/efipxe.c:1.1 src/sys/arch/i386/stand/efiboot/efipxe.c:1.2 --- src/sys/arch/i386/stand/efiboot/efipxe.c:1.1 Wed Apr 11 10:32:09 2018 +++ src/sys/arch/i386/stand/efiboot/efipxe.c Mon Jul 24 08:30:42 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: efipxe.c,v 1.1 2018/04/11 10:32:09 nonaka Exp $ */ +/* $NetBSD: efipxe.c,v 1.2 2023/07/24 08:30:42 rin Exp $ */ /* $OpenBSD: efipxe.c,v 1.3 2018/01/30 20:19:06 naddy Exp $ */ /* @@ -64,7 +64,8 @@ efi_pxe_probe(void) if (EFI_ERROR(status)) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); + depth = efi_device_path_depth(efi_bootdp, + MESSAGING_DEVICE_PATH); if (efi_device_path_ncmp(efi_bootdp, dp, depth)) continue; Index: src/sys/stand/efiboot/efipxe.c diff -u src/sys/stand/efiboot/efipxe.c:1.2 src/sys/stand/efiboot/efipxe.c:1.3 --- src/sys/stand/efiboot/efipxe.c:1.2 Thu Nov 15 23:52:33 2018 +++ src/sys/stand/efiboot/efipxe.c Mon Jul 24 08:30:42 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: efipxe.c,v 1.2 2018/11/15 23:52:33 jmcneill Exp $ */ +/* $NetBSD: efipxe.c,v 1.3 2023/07/24 08:30:42 rin Exp $ */ /* $OpenBSD: efipxe.c,v 1.3 2018/01/30 20:19:06 naddy Exp $ */ /* @@ -64,7 +64,8 @@ efi_pxe_probe(void) if (EFI_ERROR(status)) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); + depth = efi_device_path_depth(efi_bootdp, + MESSAGING_DEVICE_PATH); if (efi_device_path_ncmp(efi_bootdp, dp, depth)) continue;