tftpd: Fix max block size calculation.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38953
This commit is contained in:
Dag-Erling Smørgrav 2023-03-10 13:24:15 +00:00
parent 175a4d1042
commit a6dfd2015c

View file

@ -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) {