Date: Thu, 20 Oct 2011 22:56:02 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Sean Bruno <sbruno@freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r226580 - stable/7/libexec/tftpd Message-ID: <20111020195602.GD50300@deviant.kiev.zoral.com.ua> In-Reply-To: <201110201923.p9KJNLjx088180@svn.freebsd.org> References: <201110201923.p9KJNLjx088180@svn.freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Thu, Oct 20, 2011 at 07:23:21PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Thu Oct 20 19:23:21 2011 > New Revision: 226580 > URL: http://svn.freebsd.org/changeset/base/226580 > > Log: > MFC r224536: > Confirmed behavior of a Cisco 6509 in production. > > In the old TFTP server, there was an undocumented behavior where > the block counter would rollover to 0 if a file larger > than 65535 blocks was transferred. With the default block size > of 512 octets per block, this is a file size of approximately 32 megabytes. > > The new TFTP server code would report an error and stop transferring > the file if a file was larger than 65535 blocks. > > This patch restores the old TFTP server's behavior to the new > TFTP server code. If a TFTP client transfers a file larger > than 65535 blocks, and does *not* specify the "rollover" option, > then automatically rollover the block counter to 0 every time > we reach 65535 blocks. > > This restores interoperability with the FreeBSD 6 TFTP client. > Without this change, if a FreeBSD 6 TFTP client tried to > retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server > , the transfer would fail. > The same file could be retrieved successfully if the same FreeBSD 6 > TFTP client was used against a FreeBSD 6 TFTP server. > > Approved by: re (kib) It was not. It looks like people just think that 'Approved by: kib' is some voodo that must be appended for no reason. Today it is second time happened for the commit that I did not approved. It does not matter much for the branch opened for the general commits. Still, I would prefer that people do not falsely accuse me of wrongdoing :). > Tested by: Pawan Gupta <pawang at juniper dot net>, > Obtained from: Juniper Networks > FreeBSD7 Reviewed by: Yahoo Inc. > > > Submitted by: If someone else sent in the change. > > Reviewed by: If someone else reviewed your modification. > > Approved by: If you needed approval for this commit. > > Obtained from: If the change is from a third party. > > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > > Security: Vulnerability reference (one per line) or description. > > Empty fields above will be automatically removed. > > M tftpd/tftp-transfer.c > > Modified: > stable/7/libexec/tftpd/tftp-transfer.c > > Modified: stable/7/libexec/tftpd/tftp-transfer.c > ============================================================================== > --- stable/7/libexec/tftpd/tftp-transfer.c Thu Oct 20 19:16:52 2011 (r226579) > +++ stable/7/libexec/tftpd/tftp-transfer.c Thu Oct 20 19:23:21 2011 (r226580) > @@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, str > (*block)++; > if (oldblock > *block) { > if (options[OPT_ROLLOVER].o_request == NULL) { > - tftp_log(LOG_ERR, > - "Block rollover but not allowed."); > - send_error(peer, EBADOP); > - gettimeofday(&(ts->tstop), NULL); > - return; > + /* > + * "rollover" option not specified in > + * tftp client. Default to rolling block > + * counter to 0. > + */ > + *block = 0; > + } else { > + *block = atoi(options[OPT_ROLLOVER].o_request); > } > > - *block = atoi(options[OPT_ROLLOVER].o_request); > ts->rollovers++; > } > gettimeofday(&(ts->tstop), NULL); > @@ -196,14 +198,16 @@ tftp_receive(int peer, uint16_t *block, > (*block)++; > if (oldblock > *block) { > if (options[OPT_ROLLOVER].o_request == NULL) { > - tftp_log(LOG_ERR, > - "Block rollover but not allowed."); > - send_error(peer, EBADOP); > - gettimeofday(&(ts->tstop), NULL); > - return; > + /* > + * "rollover" option not specified in > + * tftp client. Default to rolling block > + * counter to 0. > + */ > + *block = 0; > + } else { > + *block = atoi(options[OPT_ROLLOVER].o_request); > } > > - *block = atoi(options[OPT_ROLLOVER].o_request); > ts->rollovers++; > } > [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6gfNIACgkQC3+MBN1Mb4jN1QCgx7o4jAnkdwQriqN3ov5LOWXn eUEAn1wIChRx6yh/ZnE9K6PrqzofNXYl =1RD/ -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111020195602.GD50300>
