aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorCraig Rodrigues <rodrigc@FreeBSD.org>2011-07-31 03:12:20 +0000
committerCraig Rodrigues <rodrigc@FreeBSD.org>2011-07-31 03:12:20 +0000
commit38bd7db313319ea40187c2bbc74862e0518aa98d (patch)
treebb7156c57fea13636703162ba89821b77aca93c2 /libexec
parentcfc3f4678732508085d8ae92e57ce1e1921fb803 (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/tftpd/tftp-transfer.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/libexec/tftpd/tftp-transfer.c b/libexec/tftpd/tftp-transfer.c
index fd0e00d94096..d0c8a95665ab 100644
--- a/libexec/tftpd/tftp-transfer.c
+++ b/libexec/tftpd/tftp-transfer.c
@@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, struct tftp_stats *ts)
(*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, struct tftp_stats *ts,
(*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++;
}