From nobody Fri Mar 10 13:29:15 2023 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 4PY6Mv4Qwxz3xWwk; Fri, 10 Mar 2023 13:29: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PY6Mv3yWSz3QnH; Fri, 10 Mar 2023 13:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678454955; 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=obOSHpWZwnJf0ka14pN+nIpDjzp5E7ape6R72JG9cMg=; b=IpNd7IZ2p4YeEGD0yx+oNvckwrUaYmUvXlgzus+iNlq8ePwoDsrsCkh6PH5GI5cNty65mo BZ+75Rm5vNUw4z797+rROyRW4edK8dLgRBJ9gQJLWlAxYW4D9eTGGc+k1mIzgl/86BER/k XeXvcTAM24EiW1WnR+FwdsuuOnViHY0ZV6HJSrVbRJqDk67nHQZSg/oj6xK3z1vC0b7DQF 5BUcHk3rbj6HxQHxnOiCSG6z8TyHmeJcYOhrfjlzMSTVKIjNZRKRTXs6XqaxwWHGeIuqGh wtRi5VEufFxNU1u/gKNL8knZ3CzeEn62lV7Zp8u1GAGRcPn5qu5ukWJ+WqcyVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678454955; 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=obOSHpWZwnJf0ka14pN+nIpDjzp5E7ape6R72JG9cMg=; b=UyZsKWi54QwOfxovFxWDoxdwjghADr1o7RiaphgSdx6r6b7UPW8S9FocBIqS7Jtc/29lpz ocUIH92oqKMjTYbEgEhfK/52tKnbGiOFvn+FpiQQemPUVVqYDNyRr9C4kRcm/t0p+wU9eA 43I0EKgkQq2yhK7iCqFPKiN1MG4S7TWXF3VDNAp2hIOGvoUddYLnnrSMGfAWNxfiLb+P3A ZU0TmmdA+viFODOnIoa0luKjlKqyYUxqJP3Y9/N9M2jBzlprxklslVvFU5GpbVXvhfoSBv wjkvmpNTUvXcXudc3kn4B7SPx48Ucfvs8etf4KHLrxxX++LzSwfvWnxJ9B1sbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678454955; a=rsa-sha256; cv=none; b=apM4uc01vhuij8aIWOS2veXFghKiQI7HH4jfPNyVUE9cGLPFO/SXAfTcQAPbYyxDP9Odv4 Ll5zRc1ibA8PTwai+ykDz4H87z3aLz/l9dkEFSfL9Pgy2FrSZf2uJM8I4Xyl/epA3bCvXo MrTW2T8CjsiEQzVzsx2ocJhB28ns5pQE+L3umtLOvGAz1zwYYBx/xZAsfNhGR7t8dRUjyI GG1758+o5mQj/ef3T8onlCcG0vn8BRKgSaKqqU/V3nWAKnDNfiLk3nwwxhG3dRXW0MbPYB w4NcrfnRdJ2yf2VhBjTl5Cb6eMM0BURo/vAmD00Koc7KwKyHYqmnDpWQbuV87Q== 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 4PY6Mv30qxzqsm; Fri, 10 Mar 2023 13:29:15 +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 32ADTF0j089976; Fri, 10 Mar 2023 13:29:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32ADTFRj089975; Fri, 10 Mar 2023 13:29:15 GMT (envelope-from git) Date: Fri, 10 Mar 2023 13:29:15 GMT Message-Id: <202303101329.32ADTFRj089975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: a6dfd2015c20 - main - tftpd: Fix max block size calculation. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6dfd2015c202f3424eb58846d8575a877728881 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a6dfd2015c202f3424eb58846d8575a877728881 commit a6dfd2015c202f3424eb58846d8575a877728881 Author: Dag-Erling Smørgrav AuthorDate: 2023-03-10 13:24:15 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-10 13:25:15 +0000 tftpd: Fix max block size calculation. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38953 --- libexec/tftpd/tftp-options.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/tftpd/tftp-options.c b/libexec/tftpd/tftp-options.c index 01876b4750f9..037517f9cd73 100644 --- a/libexec/tftpd/tftp-options.c +++ b/libexec/tftpd/tftp-options.c @@ -230,6 +230,7 @@ option_blksize(int peer) tftp_log(LOG_ERR, "sysctl: net.inet.udp.maxdgram"); return (acting_as_client ? 1 : 0); } + maxdgram -= 4; /* leave room for header */ int size = atoi(options[OPT_BLKSIZE].o_request); if (size < BLKSIZE_MIN || size > BLKSIZE_MAX) {