From: Joseph C. Lehner Date: Thu, 5 Sep 2019 13:26:23 +0000 (+0200) Subject: Revert "Prevent block counter rollover" X-Git-Tag: v0.9.14~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f5d0a4ffe1f57e7c5f3482ac10bb04dd755cc076;p=oweals%2Fnmrpflash.git Revert "Prevent block counter rollover" This reverts commit 49b156879aa32332adbec94e0a21c37b8b4485a1. --- diff --git a/tftp.c b/tftp.c index f81f877..06258dc 100644 --- a/tftp.c +++ b/tftp.c @@ -400,8 +400,9 @@ int tftp_put(struct nmrpd_args *args) if (timeouts || ackblock == block) { if (!timeouts) { - if (block < UINT16_MAX) { - ++block; + if (++block == 0) { + // rollover; skip to block 1 + block = 1; } pkt_mknum(tx, DATA);