Hopefully fix TFTP rollover hack
authorJoseph C. Lehner <joseph.c.lehner@gmail.com>
Thu, 1 Aug 2019 18:58:04 +0000 (20:58 +0200)
committerJoseph C. Lehner <joseph.c.lehner@gmail.com>
Thu, 1 Aug 2019 18:58:04 +0000 (20:58 +0200)
tftp.c

diff --git a/tftp.c b/tftp.c
index 1e0dd736801769e2716dee164161ea396f2d5dce..ad24057d783a737b3d213c71a1d33b8cb109066f 100644 (file)
--- a/tftp.c
+++ b/tftp.c
@@ -439,9 +439,13 @@ int tftp_put(struct nmrpd_args *args)
                                         * block #65535 - reported working on a Netgear D7000.
                                         */
                                        block = UINT16_MAX;
+                                       pkt_mknum(tx + 2, block);
                                        freeze_block = true;
                                        errors = 0;
                                        printf("Transmitting rest of file as block %d.\n", block);
+                                       /* this forces transmission of the modified packet */
+                                       timeouts = 1;
+                                       continue;
                                } else {
                                        fprintf(stderr, "Protocol error; bailing out.\n");
                                        ret = -1;