]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Bind to only the topmost instance of the SNP or NII protocols
authorMichael Brown <mcb30@ipxe.org>
Mon, 23 Jan 2023 19:18:21 +0000 (19:18 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 23 Jan 2023 19:27:13 +0000 (19:27 +0000)
commit68734b9a4dafa540e5333d7af3849b59a10f7a93
treed4b2d9f1b69c4fcc13571c30dd98041263f92b66
parent2fef0c541e4e2417fc285c4d9ddfcb6f23f394ad
[efi] Bind to only the topmost instance of the SNP or NII protocols

UEFI has the mildly annoying habit of installing copies of the
EFI_SIMPLE_NETWORK_PROTOCOL instance on the IPv4 and IPv6 child device
handles.  This can cause iPXE's SNP driver to attempt to bind to a
copy of the EFI_SIMPLE_NETWORK_PROTOCOL that iPXE itself provided on a
different handle.

Fix by refusing to bind to an SNP (or NII) handle if there exists
another instance of the same protocol further up the device path (on
the basis that we always want to bind to the highest possible device).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/efi/snp.c