projects
/
oweals
/
nmrpflash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
48a27e2
)
Fix tftp block rollover
author
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Fri, 26 Apr 2019 18:43:45 +0000
(20:43 +0200)
committer
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Fri, 26 Apr 2019 18:43:45 +0000
(20:43 +0200)
tftp.c
patch
|
blob
|
history
diff --git
a/tftp.c
b/tftp.c
index de8f765d010214cb3727d52892cabe2d2593e52d..06258dc4259e6967e6cf0fae71000b2a44e729cf 100644
(file)
--- a/
tftp.c
+++ b/
tftp.c
@@
-400,8
+400,10
@@
int tftp_put(struct nmrpd_args *args)
if (timeouts || ackblock == block) {
if (!timeouts) {
- // TODO: set block to 1 if ++block == 0 ?
- ++block;
+ if (++block == 0) {
+ // rollover; skip to block 1
+ block = 1;
+ }
pkt_mknum(tx, DATA);
pkt_mknum(tx + 2, block);