diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2019-08-20 23:38:20 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2019-08-20 23:38:20 +0000 |
commit | f71b1ecd9d6c480f8ee17759619a92d12d2811d7 (patch) | |
tree | 6e9e16de13a84408b1c5e3aa1a91c0b8ea18d703 /sys | |
parent | ea040f2c1fdfb6481acf944aae6f4f999c40ae7b (diff) |
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 (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/stand/efi32/efipxe.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/stand/efi64/efipxe.c | 6 | ||||
-rw-r--r-- | sys/arch/amd64/stand/efiboot/efipxe.c | 6 | ||||
-rw-r--r-- | sys/arch/arm64/stand/efiboot/efipxe.c | 6 | ||||
-rw-r--r-- | sys/arch/armv7/stand/efiboot/efipxe.c | 6 |
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/arch/amd64/stand/efi32/efipxe.c b/sys/arch/amd64/stand/efi32/efipxe.c index 817cf8e8f22..e48be9c1b33 100644 --- a/sys/arch/amd64/stand/efi32/efipxe.c +++ b/sys/arch/amd64/stand/efi32/efipxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efipxe.c,v 1.2 2019/08/13 09:00:20 patrick Exp $ */ +/* $OpenBSD: efipxe.c,v 1.3 2019/08/20 23:38:19 patrick Exp $ */ /* * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se> * @@ -73,8 +73,8 @@ efi_pxeprobe(void) if (status != EFI_SUCCESS) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); - if (efi_device_path_ncmp(efi_bootdp, dp0, depth)) + depth = efi_device_path_depth(efi_bootdp, MESSAGING_DEVICE_PATH); + if (depth == -1 || efi_device_path_ncmp(efi_bootdp, dp0, depth)) continue; status = EFI_CALL(BS->HandleProtocol, handles[i], &pxe_guid, diff --git a/sys/arch/amd64/stand/efi64/efipxe.c b/sys/arch/amd64/stand/efi64/efipxe.c index 817cf8e8f22..e48be9c1b33 100644 --- a/sys/arch/amd64/stand/efi64/efipxe.c +++ b/sys/arch/amd64/stand/efi64/efipxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efipxe.c,v 1.2 2019/08/13 09:00:20 patrick Exp $ */ +/* $OpenBSD: efipxe.c,v 1.3 2019/08/20 23:38:19 patrick Exp $ */ /* * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se> * @@ -73,8 +73,8 @@ efi_pxeprobe(void) if (status != EFI_SUCCESS) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); - if (efi_device_path_ncmp(efi_bootdp, dp0, depth)) + depth = efi_device_path_depth(efi_bootdp, MESSAGING_DEVICE_PATH); + if (depth == -1 || efi_device_path_ncmp(efi_bootdp, dp0, depth)) continue; status = EFI_CALL(BS->HandleProtocol, handles[i], &pxe_guid, diff --git a/sys/arch/amd64/stand/efiboot/efipxe.c b/sys/arch/amd64/stand/efiboot/efipxe.c index 47bdede487f..82c5a019688 100644 --- a/sys/arch/amd64/stand/efiboot/efipxe.c +++ b/sys/arch/amd64/stand/efiboot/efipxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efipxe.c,v 1.5 2019/08/13 09:00:20 patrick Exp $ */ +/* $OpenBSD: efipxe.c,v 1.6 2019/08/20 23:38:19 patrick Exp $ */ /* * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se> * @@ -73,8 +73,8 @@ efi_pxeprobe(void) if (status != EFI_SUCCESS) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); - if (efi_device_path_ncmp(efi_bootdp, dp0, depth)) + depth = efi_device_path_depth(efi_bootdp, MESSAGING_DEVICE_PATH); + if (depth == -1 || efi_device_path_ncmp(efi_bootdp, dp0, depth)) continue; status = EFI_CALL(BS->HandleProtocol, handles[i], &pxe_guid, diff --git a/sys/arch/arm64/stand/efiboot/efipxe.c b/sys/arch/arm64/stand/efiboot/efipxe.c index 9a9af5886fa..fb01d65aceb 100644 --- a/sys/arch/arm64/stand/efiboot/efipxe.c +++ b/sys/arch/arm64/stand/efiboot/efipxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efipxe.c,v 1.6 2019/08/13 09:00:20 patrick Exp $ */ +/* $OpenBSD: efipxe.c,v 1.7 2019/08/20 23:38:19 patrick Exp $ */ /* * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se> * @@ -96,8 +96,8 @@ efi_pxeprobe(void) if (status != EFI_SUCCESS) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); - if (efi_device_path_ncmp(efi_bootdp, dp0, depth)) + depth = efi_device_path_depth(efi_bootdp, MESSAGING_DEVICE_PATH); + if (depth == -1 || efi_device_path_ncmp(efi_bootdp, dp0, depth)) continue; status = EFI_CALL(BS->HandleProtocol, handles[i], &net_guid, diff --git a/sys/arch/armv7/stand/efiboot/efipxe.c b/sys/arch/armv7/stand/efiboot/efipxe.c index 654d3474ab6..073e10fca5d 100644 --- a/sys/arch/armv7/stand/efiboot/efipxe.c +++ b/sys/arch/armv7/stand/efiboot/efipxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efipxe.c,v 1.3 2019/08/13 09:00:20 patrick Exp $ */ +/* $OpenBSD: efipxe.c,v 1.4 2019/08/20 23:38:19 patrick Exp $ */ /* * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se> * @@ -96,8 +96,8 @@ efi_pxeprobe(void) if (status != EFI_SUCCESS) continue; - depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); - if (efi_device_path_ncmp(efi_bootdp, dp0, depth)) + depth = efi_device_path_depth(efi_bootdp, MESSAGING_DEVICE_PATH); + if (depth == -1 || efi_device_path_ncmp(efi_bootdp, dp0, depth)) continue; status = EFI_CALL(BS->HandleProtocol, handles[i], &net_guid, |