From nobody Tue Sep 29 19:57:14 2026 X-Original-To: dev-commits-src-main@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 4hvTV33hvzz6v4nm 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 4hvTV26vC3z4dWW 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=1790711835; 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=sJXjKSNaBTllLFFgMqD9fc9yBN9lGSqu4AHPJTpzbhEWzMvq+BFxn5y4lj74EzpJCGQqPP 6chAj6HAsrzoEy6rbyEl5pkGhpuv4geZ0acwx/F2CPrUF99AAt2Zkt+Woms74uN+ZtPZ0s 4lvqUY2OgQvxQXFZLc/dF+Ilql5gTrCleByZvNwerFC4vW7ET8VK6/3ladY5DEFLjYXFe+ nOkt3sFJyGOLWwajVuGYUlp9AXCCGptVvMq3qalgExoMiFvqAeIM7lf3djQNKELekOtGgu BBW+ThKvEM8PSvzhWdxvFW2YDCHC5SgQQSCokeRJoX36S+bFBP9HymczXGOY+g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790711835; b=byhmWfeQVJb5Nqo+2LKkPlVmxCdP9ILrR2af9B6j1DzGaYA7xzqLv2cIxjOJaDU6ZJROAM IkNRTAvE3mjxRjdRFWISfTyAhOB9g7Qj2UeGKYlg7H+0hZG2XU9styDldvnhHKa8uYNB1L oEDLi9Mp0WSEHw/GcXvZAn0F7zGH1nyBvHcdXff1BU675J91Oa41GMFWmaclrTj6ubUo6R 2NOFcL4ybLykHBeZZoCxQWJd9gSXX4i+mQ4pnuAuL8yjQcM+FSr9SJTecf0L7HGZh3BKCg lF5Frp2MIKUqygt3l9pDWOfKxutYgHn09nLiDS7ewUBECg3Wn1uOb8RFlxhsKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790711835; 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=g9Dss3O5F4Slneyzml2J58B+UVViexyyV7GxOPWoTVbiwHJRoErPVc/4Ql53ecCkyEt39o dBJTj2Nxlp2xifS0+65Efxvbc5O7miVRlFanTMOyq7fFt5w7BWtUjV8U1rGlb2Dqbljpdf RkFM/eaLw45z4BrLVm4MCNydlF5QnYpbQm9HXkzgIPVGcCYzRvKNdFPuGosZhcQZEFNoyJ 2STEkGT5CGDDMm5PIcSz9zG4ElnMkL6oPV+dnUGyTl5vET7Z+Hkkvw5BivQCF9T+BVfjYA MWG0tVN3bA3TmNsTSVPjjdL57TR9o/Z4tT358V40Bgq85CXE0YbLHFvS57PEfg== 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 4hvTV25YXhz1RZL 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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)