summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/libefi
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2015-01-30 18:25:53 +0000
committerambrisko <ambrisko@FreeBSD.org>2015-01-30 18:25:53 +0000
commitf50c52a6c1aef4397eac2417e238f3e38aeb9277 (patch)
treec95f73522a7d72e4a6262216166e13e40cc5ec15 /sys/boot/efi/libefi
parent5ae27b10668e5c87136e3e5cb7426d5eacf950ad (diff)
downloadFreeBSD-src-f50c52a6c1aef4397eac2417e238f3e38aeb9277.zip
FreeBSD-src-f50c52a6c1aef4397eac2417e238f3e38aeb9277.tar.gz
Fix UEFI PXE boot on a NIC that isn't the first NIC.
In UEFI it appears all available NICS are present to pass network traffic. This gives the capability to load the loader.efi from disk then set currdev="net3:" and then all I/O will over over the 2nd NIC. On this machine is appears the first handle is the first NIC in IPv4 mode and then the 2nd handle is the first NIC in IPv6 mode. The 3rd handle is the 2nd NIC in IPv4 mode. The fix is to index into the handle based on the unit cached from boot device passed into the loader. Some testing info from a test boot via kenv: currdev="net3:" loaddev="net3:" boot.netif.name="igb1"
Diffstat (limited to 'sys/boot/efi/libefi')
-rw-r--r--sys/boot/efi/libefi/efinet.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/boot/efi/libefi/efinet.c b/sys/boot/efi/libefi/efinet.c
index 3f08ed2..f1e6143 100644
--- a/sys/boot/efi/libefi/efinet.c
+++ b/sys/boot/efi/libefi/efinet.c
@@ -99,8 +99,11 @@ dump_mode(EFI_SIMPLE_NETWORK_MODE *mode)
static int
efinet_match(struct netif *nif, void *machdep_hint)
{
+ struct devdesc *dev = machdep_hint;
- return (1);
+ if (dev->d_unit - 1 == nif->nif_unit)
+ return (1);
+ return(0);
}
static int
OpenPOWER on IntegriCloud