From: Daniel Stenberg Date: Fri, 21 May 2010 21:07:59 +0000 (+0200) Subject: TFTP: don't ack if wrong block num is received X-Git-Tag: curl-7_21_0~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bb6deda721796c8bf501c8bcbf86998b51f2828;p=curl TFTP: don't ack if wrong block num is received If an unexpected block number was received, break out of the switch loop. --- 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;