Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 2015 18:25:54 +0000 (UTC)
From:      Doug Ambrisko <ambrisko@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277943 - head/sys/boot/efi/libefi
Message-ID:  <201501301825.t0UIPsf0089220@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ambrisko
Date: Fri Jan 30 18:25:53 2015
New Revision: 277943
URL: https://svnweb.freebsd.org/changeset/base/277943

Log:
  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"

Modified:
  head/sys/boot/efi/libefi/efinet.c

Modified: head/sys/boot/efi/libefi/efinet.c
==============================================================================
--- head/sys/boot/efi/libefi/efinet.c	Fri Jan 30 18:19:22 2015	(r277942)
+++ head/sys/boot/efi/libefi/efinet.c	Fri Jan 30 18:25:53 2015	(r277943)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501301825.t0UIPsf0089220>