Prevent block counter rollover
This commit is contained in:
parent
826ff59150
commit
49b156879a
1 changed files with 2 additions and 3 deletions
5
tftp.c
5
tftp.c
|
@ -400,9 +400,8 @@ int tftp_put(struct nmrpd_args *args)
|
|||
|
||||
if (timeouts || ackblock == block) {
|
||||
if (!timeouts) {
|
||||
if (++block == 0) {
|
||||
// rollover; skip to block 1
|
||||
block = 1;
|
||||
if (block < UINT16_MAX) {
|
||||
++block;
|
||||
}
|
||||
|
||||
pkt_mknum(tx, DATA);
|
||||
|
|
Loading…
Add table
Reference in a new issue