From f5d0a4ffe1f57e7c5f3482ac10bb04dd755cc076 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Thu, 5 Sep 2019 15:26:23 +0200 Subject: [PATCH] Revert "Prevent block counter rollover" This reverts commit 49b156879aa32332adbec94e0a21c37b8b4485a1. --- tftp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.25.1