Revert "Conditionally enable TFTP block rollover hack"
This reverts commit b3ba1c016b
.
This commit is contained in:
parent
68fb396869
commit
73a1c11f4f
1 changed files with 4 additions and 16 deletions
14
tftp.c
14
tftp.c
|
@ -314,7 +314,6 @@ int tftp_put(struct nmrpd_args *args)
|
|||
char rx[2048], tx[2048];
|
||||
const char *file_remote = args->file_remote;
|
||||
char *val, *end;
|
||||
bool freeze_block = false;
|
||||
|
||||
sock = -1;
|
||||
ret = -1;
|
||||
|
@ -401,7 +400,7 @@ int tftp_put(struct nmrpd_args *args)
|
|||
|
||||
if (timeouts || ackblock == block) {
|
||||
if (!timeouts) {
|
||||
if (!freeze_block) {
|
||||
if (block < UINT16_MAX) {
|
||||
++block;
|
||||
}
|
||||
|
||||
|
@ -433,22 +432,11 @@ int tftp_put(struct nmrpd_args *args)
|
|||
}
|
||||
|
||||
if (ackblock != -1 && ++errors > 5) {
|
||||
if (ackblock == UINT16_MAX && block == 0 && !freeze_block) {
|
||||
/* work around the 32 MiB limit if block rollover is not
|
||||
* supported, by transmitting all remaining packets as
|
||||
* block #65535 - reported working on a Netgear D7000.
|
||||
*/
|
||||
block = UINT16_MAX;
|
||||
freeze_block = true;
|
||||
errors = 0;
|
||||
printf("Transmitting rest of file as block %d.\n", block);
|
||||
} else {
|
||||
fprintf(stderr, "Protocol error; bailing out.\n");
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ret = tftp_recvfrom(sock, rx, &port, args->rx_timeout, blksize + 4);
|
||||
if (ret < 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue