aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-05-21 23:07:59 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-05-21 23:07:59 +0200
commit0bb6deda721796c8bf501c8bcbf86998b51f2828 (patch)
treea4dd53e4da95343dc8e0bd039beac990e73f84c7 /lib
parent0a29e2445c8d7300b5d72e2ba05755ea1ad5b6d1 (diff)
TFTP: don't ack if wrong block num is received
If an unexpected block number was received, break out of the switch loop.
Diffstat (limited to 'lib')
-rw-r--r--lib/tftp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index 20e5fd5da..1228297e0 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -599,11 +599,12 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
infof(data,
"Received unexpected DATA packet block %d\n", rblock);
state->retries++;
- if(state->retries>state->retry_max) {
+ if(state->retries > state->retry_max) {
failf(data, "tftp_rx: giving up waiting for block %d",
NEXT_BLOCKNUM(state->block));
return CURLE_TFTP_ILLEGAL;
}
+ break;
}
/* This is the expected block. Reset counters and ACK it. */
state->block = (unsigned short)rblock;