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:
826ff59
)
Prevent block counter rollover
author
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Mon, 29 Apr 2019 08:51:38 +0000
(10:51 +0200)
committer
Joseph C. Lehner
<joseph.c.lehner@gmail.com>
Mon, 29 Apr 2019 08:51:38 +0000
(10:51 +0200)
tftp.c
patch
|
blob
|
history
diff --git
a/tftp.c
b/tftp.c
index 06258dc4259e6967e6cf0fae71000b2a44e729cf..f81f877938309fc9d2e6611832b2b0aaf7b057f4 100644
(file)
--- a/
tftp.c
+++ b/
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);