From nobody Thu Aug 21 06:40:27 2025 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 4c6txH2PSCz65swP; Thu, 21 Aug 2025 06:40:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c6txH1qM1z3qMj; Thu, 21 Aug 2025 06:40:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755758435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dAL3HC+cUK1H4zbE6cqmmcEpXxgajHsrtRGOG2UblPE=; b=cQnSXBfnIkpkFOraNLK8C64DY5YlnFdZ1mWa4VJjTzcTrr2jMm0qq+I/xxyJwBgm1Nv1nF y7aiu7BrSbJV7/MRdrZV1gpK8k2guUJXANtSJQCFkJnsR00vbfb2ovRLCCF7IfB1BxkYYV 989edEJPQ36jQJnRQigk0YHWtSTiIRDygqH5w6TQqNY5Hynbegt3XsEm0zeE9/SwAA+YVt EKRD+Fa5sqCyc60avkQ+tiA/r5y9SRNobQE/OftzQT4aAkKI5oiYUSUEO17XoUDeDMJjGJ SLUX8xWiLpy9NA1UDwIgW6fGoYln1JB1Vi8u4naFkzABR6vOoo4tia6w3ebb0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755758435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dAL3HC+cUK1H4zbE6cqmmcEpXxgajHsrtRGOG2UblPE=; b=V7scDHmgiHrOESji33y9e5Jbjaqo+4ntfwKYFnqWCLO0rVCYGeZdKW7fcVMOtYoNOnW+a1 TFW64H7AG4kInC4iwdPHLbyO2aptXOQORY7LYw9EwfP80hAViAVK3aIrZgPSykgankrTtD DRXGotNNM++/UcZDtNGghjMw9Cndsw7GSiZ63FydmXMuE0ktBafq/YDY3vMa9LSMi6eGXY 8sjJB9jJ5NZ6vyrLZYP/a58jdUPmdKd5TsMCT3ETNVYYzofSZMhLUImjaMVueV9kyKePLn HE//OT1EA9vGSbZh4NpDxiqz4nbeQMha9ofXoMoPEr9Sg5Au6gEI4elZx0QkVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755758435; a=rsa-sha256; cv=none; b=httbG4K2lFqg2ETaE8sZfhQhzCjCzxeFFnHrt0X5/jR2QCLVYkIh8jFN7KcuAh+fL86n7/ mVvzvwjphMSzTB5rrgdAH9DlkM2UYbf6aBjbR/TGdPB2tyvM4yaNtJ4fljQXLxDvu/4AXy kUlIFSULi+7UzPf2sAKz9YifiPhcopr3D08h2Eulq6ZRiIu3uBgLmBNn+ftwPzckeERlSZ XTjHamVmYyQcQAyXq3urKxkGr/jbkNmLR35v/I7/QLuiwOBMNuKlMmRmvt4HqiJfcX7z/7 r+97hrHWtQaNXNZs+HOu710CSxTdNLjs9HsSrZgdqGYT9Utyppn2IsMbnDbtiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (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 ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4c6txG5drRz17dD; Thu, 21 Aug 2025 06:40:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id AA8A9A64805; Thu, 21 Aug 2025 06:40:25 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 291EF2D029E1; Thu, 21 Aug 2025 06:40:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id n02-OH7AQPo5; Thu, 21 Aug 2025 06:40:30 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:a66b:b6ff:fe40:39a9]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9F39F2D029D8; Thu, 21 Aug 2025 06:40:30 +0000 (UTC) Date: Thu, 21 Aug 2025 06:40:27 +0000 (UTC) From: "Bjoern A. Zeeb" To: A FreeBSD User cc: "Simon J. Gerraty" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: b44cc1b479fe - main - loader: do not try to open directories with TFTP In-Reply-To: <20250821060752.001c9599@thor.sb211.local> Message-ID: <8006s3o4-3nns-509q-n89q-oq88r8o09sn8@SerrOFQ.bet> References: <202508202248.57KMmcTO016280@gitrepo.freebsd.org> <20250821060752.001c9599@thor.sb211.local> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Thu, 21 Aug 2025, A FreeBSD User wrote: > Am Tage des Herren Wed, 20 Aug 2025 22:48:38 GMT > "Simon J. Gerraty" schrieb: > >> The branch main has been updated by sjg: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=b44cc1b479fefc8570611309c3f5a6966fb26e3b >> >> commit b44cc1b479fefc8570611309c3f5a6966fb26e3b >> Author: Simon J. Gerraty >> AuthorDate: 2025-08-20 22:45:54 +0000 >> Commit: Simon J. Gerraty >> CommitDate: 2025-08-20 22:45:54 +0000 >> >> loader: do not try to open directories with TFTP >> >> Attempting to mount or even open / with some tftp servers >> causes a several minute delay in boot. >> >> Since opening a directory via TFTP does not make sense, we >> avoid it. We don't know if using TFTP until after net_open() >> has been called. >> >> Add an is_tftp() accessor to avoid everyone having to include >> all the net* headers. >> >> Sponsored by: Juniper Networks, Inc. >> Differential Revision: https://reviews.freebsd.org/D51447 >> --- >> stand/common/dev_net.c | 9 ++++++++- >> stand/libsa/mount.c | 5 ++++- >> stand/libsa/open.c | 8 ++++++++ >> stand/libsa/stand.h | 3 +++ >> 4 files changed, 23 insertions(+), 2 deletions(-) > > Build of world/kernel fails with the error below: > > [...] > > --- all_subdir_stand/i386 --- > --- all_subdir_stand/i386/gptzfsboot --- > ld: error: undefined symbol: is_tftp >>>> referenced by open.c >>>> open.o:(open) in archive /usr/obj/usr/src/amd64.amd64/stand/libsa32/libsa32.a >>>> referenced by mount.c >>>> mount.o:(mount) in archive >>>> /usr/obj/usr/src/amd64.amd64/stand/libsa32/libsa32.a > --- all_subdir_usr.sbin --- > -function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member > -Qunused-arguments -c /usr/src/contrib/tcpdump/print-ntp.c -o print-ntp.pieo --- > all_subdir_stand --- *** [gptzfsboot.out] Error code 1 shot in the dark (haven't checked that LOADER_NET_SUPPORT would be defined for these files): diff --git stand/libsa/mount.c stand/libsa/mount.c index c866dc9c7055..4b579c17a782 100644 --- stand/libsa/mount.c +++ stand/libsa/mount.c @@ -109,8 +109,10 @@ mount(const char *dev, const char *path, int flags __unused, void *data) continue; DEBUG_PRINTF(1,("%s: fs=%s path=%s\n", __func__, fs->fs_name, path)); +#ifdef LOADER_NET_SUPPORT if (is_tftp()) break; +#endif if (fs->fo_mount(dev, path, &data) != 0) continue; diff --git stand/libsa/open.c stand/libsa/open.c index 91848aca7dbe..0e44dc7b0942 100644 --- stand/libsa/open.c +++ stand/libsa/open.c @@ -138,8 +138,10 @@ open(const char *fname, int mode) struct fs_ops *fs; struct open_file *f; int fd, i, error, besterror; +#ifdef LOADER_NET_SUPPORT bool is_dir; size_t n; +#endif const char *file; TSENTER(); @@ -184,14 +186,18 @@ open(const char *fname, int mode) /* pass file name to the different filesystem open routines */ besterror = ENOENT; +#ifdef LOADER_NET_SUPPORT n = strlen(file); is_dir = (n > 0 && file[n - 1] == '/'); +#endif for (i = 0; file_system[i] != NULL; i++) { fs = file_system[i]; +#ifdef LOADER_NET_SUPPORT if (is_dir && is_tftp()) { error = EOPNOTSUPP; goto err; } +#endif error = (fs->fo_open)(file, f); if (error == 0) goto ok; -- Bjoern A. Zeeb r15:7