TFTP: don't ack if wrong block num is received
If an unexpected block number was received, break out of the switch loop.
This commit is contained in:
parent
0a29e2445c
commit
0bb6deda72
@ -599,11 +599,12 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||||||
infof(data,
|
infof(data,
|
||||||
"Received unexpected DATA packet block %d\n", rblock);
|
"Received unexpected DATA packet block %d\n", rblock);
|
||||||
state->retries++;
|
state->retries++;
|
||||||
if(state->retries>state->retry_max) {
|
if(state->retries > state->retry_max) {
|
||||||
failf(data, "tftp_rx: giving up waiting for block %d",
|
failf(data, "tftp_rx: giving up waiting for block %d",
|
||||||
NEXT_BLOCKNUM(state->block));
|
NEXT_BLOCKNUM(state->block));
|
||||||
return CURLE_TFTP_ILLEGAL;
|
return CURLE_TFTP_ILLEGAL;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
/* This is the expected block. Reset counters and ACK it. */
|
/* This is the expected block. Reset counters and ACK it. */
|
||||||
state->block = (unsigned short)rblock;
|
state->block = (unsigned short)rblock;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user