From nobody Tue Sep 29 19:57:14 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hvTV30BR3z6v4m0 for ; Tue, 29 Sep 2026 19:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hvTV26lnzz4dkW for ; Tue, 29 Sep 2026 19:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790711834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XGB5wpBaenfeIomC9WAKPaBBvkau6DYNoVYFhEIh10o=; b=p4Fvxyhx4s5gHntMBGSLWOMaczKfOkARm9JbecX1XUAUQhHdlhuLjzseo+iCypPF1CMsoy T2jK0VaI0Fdrl7NHw/aHq0yrVDL73v+8DASEVnrb64gCMgRMg+1QpK486aWZFqafistoCW m/o3Gp2bmH0h6qGyFv2w/7Oio+WhZLdMvBl9Agvw3aJVMdXSwQGKYkh0XmCiHFyDxWL6Ns TtqTZ673Zz6sUFE1dKcyp2i9Lr5hi4WhIoEW8MAYAn+eb+YimiC2odmVui9UHwXCrZ77b5 CmWhLslgudiWxXopZTMTyF4sn0Ysb7FNxhVwpI5QJ2+Vt1M0S2Pro8OQK/imHg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790711834; b=V+JpjYFMzaTEyq8w1k1+QQwY/Dg1wm9J8dcjU3qw2GMRc4ltVC0VHVlaTreM/YViPqAGTX 0ruLqHxiKcI5wFcVwtWp6uMdaIAJa1OB4UjYB6TQeFGZ7sGrsLOmCwI761oYQl+VqrF0jV k46sATmsmURmKD1qzMm7asdsMrHMD5xiTtlBJH+zSr4cWQtB/nP3+hrGIJzOVVbB95lYx7 xxctewnkuHIhN9eOhGmHl5wVWr9aUiuEC6g2mheBXq7JH/bVO0vzvIlyOReMCOcKk127Fl BWdxt8Y4s/XiCrQYK8R/Jve4v1o8RzYsFHpWtvsDMgl9ytAZ5QXucG0wofJ4NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790711834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XGB5wpBaenfeIomC9WAKPaBBvkau6DYNoVYFhEIh10o=; b=RGaaVec9miuev1nG8OT1mFiiISyA/qi7DeG+gzJylu8Aj3X7SeoHTZS2bp5rO7eew8v87d CGePbN6qbnk57UKA3eBycqoGCIqRhCTg+2SzwyhxW4RStBzfuQ2/atdFZgWoZHwlB2igbM Tq74bC2WTSKGeQzPmaAcD2dZpcKWMyNcp518xW12/CIIa7SS9FaUsPasLbFkj8pAw89WIe ovJJ0ABAGEU2DHt2Jlg9VMdQlkcqiRrHrhKUTb3JLAkZwf7j6spHirHIcRPAkMWxJVxwrw 0SKGkXdpwQDVDGznPZF5ADbj2rgjq4fJUTQ9Vbz4BChSCZeATg1GhDE9HRfbSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hvTV25VVhz1Rnv for ; Tue, 29 Sep 2026 19:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19156 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 29 Sep 2026 19:57:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Krzysztof Galazka Subject: git: 48b29e9e54c5 - main - loader.efi: Retain standalone network configuration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kgalazka X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48b29e9e54c592767fa363237e9837c90c8d7ccd Auto-Submitted: auto-generated Date: Tue, 29 Sep 2026 19:57:14 +0000 Message-Id: <6abc181a.19156.757f3655@gitrepo.freebsd.org> The branch main has been updated by kgalazka: URL: https://cgit.FreeBSD.org/src/commit/?id=48b29e9e54c592767fa363237e9837c90c8d7ccd commit 48b29e9e54c592767fa363237e9837c90c8d7ccd Author: Krzysztof Galazka AuthorDate: 2026-09-29 19:56:43 +0000 Commit: Krzysztof Galazka CommitDate: 2026-09-29 19:56:48 +0000 loader.efi: Retain standalone network configuration DHCP initmd discovery used net_configure() to open and configure SNP, then immediately closed the socket and released the protocol. Selecting net0 as currdev subsequently required another exclusive SNP attach, which may hang on some EDK II firmware. Keep the configured socket available for ordinary network consumers so NFS boot can reuse it. Add an explicit deconfiguration operation and invoke it only when an initmd URL requires handing SNP back to the firmware network stack. Signed-off-by: Krzysztof Galazka Reviewed by: imp Assisted by: Github Copilot (GPT-5.6 Sol) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D59999 --- stand/common/dev_net.c | 33 +++++++++++++++++++++++++++------ stand/common/dev_net.h | 1 + stand/efi/loader/memdisk.c | 2 ++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c index aecb5bcde81c..3c13ad99ec5a 100644 --- a/stand/common/dev_net.c +++ b/stand/common/dev_net.c @@ -176,21 +176,42 @@ net_open(struct open_file *f, ...) int net_configure(struct devdesc *dev) { - int error, sock; + int error; - sock = netif_open(dev); - if (sock < 0) + if (netdev_sock >= 0) + return (0); + + netdev_sock = netif_open(dev); + if (netdev_sock < 0) return (ENXIO); error = 0; if (rootip.s_addr == 0) - error = net_getparams(sock); + error = net_getparams(netdev_sock); if (error == 0) - net_setparams(sock); - netif_close(sock); + net_setparams(netdev_sock); + if (error != 0) { + netif_close(netdev_sock); + netdev_sock = -1; + return (error); + } + + netdev_name = strdup(dev->d_dev->dv_name); + if (netdev_name == NULL) { + netif_close(netdev_sock); + netdev_sock = -1; + return (ENOMEM); + } return (error); } +void +net_deconfigure(void) +{ + + net_cleanup(); +} + static int net_close(struct open_file *f) { diff --git a/stand/common/dev_net.h b/stand/common/dev_net.h index 5cf6652c96af..a216f745e219 100644 --- a/stand/common/dev_net.h +++ b/stand/common/dev_net.h @@ -30,6 +30,7 @@ extern struct devsw netdev; int net_configure(struct devdesc *); +void net_deconfigure(void); uint32_t net_parse_rootpath(void); #endif diff --git a/stand/efi/loader/memdisk.c b/stand/efi/loader/memdisk.c index 8990f9393e85..6a4fb5b31f45 100644 --- a/stand/efi/loader/memdisk.c +++ b/stand/efi/loader/memdisk.c @@ -245,6 +245,8 @@ maybe_download_initmd(void) if (url == NULL || *url == '\0') return; + /* Release SNP so the firmware network stack can fetch the image. */ + net_deconfigure(); printf("Downloading initmd from %s\n", url); error = download_md_image(url); if (error != 0 && error != ECANCELED)