Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/stand/efiboot MI and x86 efiboot: Fix device path type f...



details:   https://anonhg.NetBSD.org/src/rev/e1bd8948950f
branches:  trunk
changeset: 378163:e1bd8948950f
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Jul 24 08:30:42 2023 +0000

description:
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@

diffstat:

 sys/arch/i386/stand/efiboot/efipxe.c |  5 +++--
 sys/stand/efiboot/efipxe.c           |  5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 835a2aaa48b6 -r e1bd8948950f sys/arch/i386/stand/efiboot/efipxe.c
--- a/sys/arch/i386/stand/efiboot/efipxe.c      Mon Jul 24 08:21:09 2023 +0000
+++ b/sys/arch/i386/stand/efiboot/efipxe.c      Mon Jul 24 08:30:42 2023 +0000
@@ -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;
 
diff -r 835a2aaa48b6 -r e1bd8948950f sys/stand/efiboot/efipxe.c
--- a/sys/stand/efiboot/efipxe.c        Mon Jul 24 08:21:09 2023 +0000
+++ b/sys/stand/efiboot/efipxe.c        Mon Jul 24 08:30:42 2023 +0000
@@ -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;
 



Home | Main Index | Thread Index | Old Index