git: 5bbd617cc5fe - main - loader.efi: release SNP after network configuration

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 11 Sep 2026 05:04:27 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=5bbd617cc5fe10949a856e7f75cd616c24b3438b

commit 5bbd617cc5fe10949a856e7f75cd616c24b3438b
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2026-09-11 04:14:12 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-09-11 04:15:28 +0000

    loader.efi: release SNP after network configuration
    
    Close the exclusively opened SNP protocol after loader networking
    finishes so the firmware network stack can reconnect the controller and
    service a subsequent HTTP request.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D59430
---
 stand/efi/libefi/efinet.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/stand/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c
index 26a84e0e8d8e..18e437a9823a 100644
--- a/stand/efi/libefi/efinet.c
+++ b/stand/efi/libefi/efinet.c
@@ -536,11 +536,15 @@ static void
 efinet_end(struct netif *nif)
 {
 	EFI_SIMPLE_NETWORK *net = nif->nif_devdata;
+	EFI_HANDLE h;
 
 	if (net == NULL)
 		return;
 
 	net->Shutdown(net);
+	h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private;
+	BS->CloseProtocol(h, &sn_guid, IH, NULL);
+	nif->nif_devdata = NULL;
 }
 
 static int efinet_dev_init(void);