From nobody Thu Jan 13 09:49:10 2022 X-Original-To: dev-commits-src-branches@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 A2FBB12D24AA; Thu, 13 Jan 2022 09:49:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JZKQG4tDkz4j9G; Thu, 13 Jan 2022 09:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642067350; 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=K//kBNzidYFgJAMID7TLH4mx3NanarkJclY71J7yQQ4=; b=y0qo/aPbnlbDwH+50iTfkebEpE/kqkfrrVWfaTeNF47Ikt4ax+0NrudEjv7/4D6uMLcFSg sqfjvKZtAQt/0Q7xB/oB0m0x58lKdFZYFqy/1TrKyWyMjtrJm6KpuJ8V3S/VdpmoSsY/dK nm2Qa9ORvexzkhvsASFkhQoLYoY04e5qIXsEfe5Z+X/B85UV0mlLwYG920a7+u8BZUe865 hm//9RAI+ijocNg3lCQpREnPgMyGBGxFlfY5ecM2NtDPVSAq7UIOW6wj5anMMN+bRQU25t JwHYr9vWd7MB0T4KtW7aavXODwtzpooH6AxFaV82KWFhwMFkw9FuGnjuMBWtXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AE961E51C; Thu, 13 Jan 2022 09:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20D9nAwC096028; Thu, 13 Jan 2022 09:49:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20D9nAC6096027; Thu, 13 Jan 2022 09:49:10 GMT (envelope-from git) Date: Thu, 13 Jan 2022 09:49:10 GMT Message-Id: <202201130949.20D9nAC6096027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: d37a33f52c36 - stable/13 - loader: tftp: Copy the first block into the cache List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d37a33f52c369f071d036d3cf8940215f682c636 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642067350; 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=K//kBNzidYFgJAMID7TLH4mx3NanarkJclY71J7yQQ4=; b=MLTO8zrIEF8RF/VUzpo97M4aIZLJ7zOtoA4w4a4+6G/qB6dID0r1vi4H32expCPj//HEJZ 7+gvUb+Ck6HTHbCv3wRYqdqvJMUAnYiPUNCeauaU44CRyCoOQ32Sv2ctuF3yuiwYv1Ul7v N1NUD/MUKLd6a0qpEptYRAq6ZX2g/uyvAwN9rQJlfoWj5vUopobla7BxW3CI2w3kZpyYrv CBHDk7TyMGtzP4CrhMgqsdWF/9uT+kH9A4DQPaJQEktcRPKRgU5RxYLvC9x7eEsh3HKsR7 CgZqD1b1ZXyMiViQ8pLqehZ7SyOgY96KSIJJhVhs3+JS6xfp+9jRHS9Sy8JqcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642067350; a=rsa-sha256; cv=none; b=iW2H6a0zWqOjor9zghaXtqCUfCU42bfeFXVAb57GF47tgmSFRfEIlncqDCo8rLdYSeMpXH 6uvVjIBFNWrdEO1Rx0PAqkOdwG5/N/Oet5bMLCgwnuPIUnKcWEeQoR0D+xogWr7l/GJXsi ZJ0JFFij4SRmsmcYZEURwHeAH58GCmvWL/KaHB3CX8kZvAT5OzBauZNLRJwZEbo7G7MRmj BLsqIUc/KJGZvAMDBmH7pUAMiXt3O8URCb8KEx3eSDd1h0crFEefU6aMP1T+nQNBTW1oV4 MtwFPe/7uoWYjT4F7dUW+Ax5HJUSCbebHPcOQpw0DsOk09xfsmRPhpyjLGu7Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d37a33f52c369f071d036d3cf8940215f682c636 commit d37a33f52c369f071d036d3cf8940215f682c636 Author: Emmanuel Vadot AuthorDate: 2021-12-30 08:47:06 +0000 Commit: Emmanuel Vadot CommitDate: 2022-01-13 07:59:03 +0000 loader: tftp: Copy the first block into the cache tftp_open reads the first block so copy it in the cached data. If we have more than one block (i.e. we called tftp_read before tftp_preload) simply just reset the transfer. Reported by: mmel Reviewed by: mmel, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33697 (cherry picked from commit dfc9c1d4937d0e2eab2910665069faba814bca1e) --- stand/libsa/tftp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c index f91974fbff5d..d3f3048e0257 100644 --- a/stand/libsa/tftp.c +++ b/stand/libsa/tftp.c @@ -677,6 +677,13 @@ tftp_preload(struct open_file *f) start = getsecs(); printf("Preloading %s ", tftpfile->path); #endif + if (tftpfile->currblock == 1) + bcopy(tftpfile->tftp_hdr->th_data, + cache, + tftpfile->validsize); + else + tftpfile->currblock = 0; + while (tftpfile->islastblock == 0) { twiddle(32); rc = tftp_getnextblock(tftpfile);