Fix tftp block rollover
This commit is contained in:
parent
48a27e289c
commit
2d4a5948fc
1 changed files with 4 additions and 2 deletions
6
tftp.c
6
tftp.c
|
@ -400,8 +400,10 @@ int tftp_put(struct nmrpd_args *args)
|
||||||
|
|
||||||
if (timeouts || ackblock == block) {
|
if (timeouts || ackblock == block) {
|
||||||
if (!timeouts) {
|
if (!timeouts) {
|
||||||
// TODO: set block to 1 if ++block == 0 ?
|
if (++block == 0) {
|
||||||
++block;
|
// rollover; skip to block 1
|
||||||
|
block = 1;
|
||||||
|
}
|
||||||
|
|
||||||
pkt_mknum(tx, DATA);
|
pkt_mknum(tx, DATA);
|
||||||
pkt_mknum(tx + 2, block);
|
pkt_mknum(tx + 2, block);
|
||||||
|
|
Loading…
Add table
Reference in a new issue