#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
#ifndef PACKED
#define PACKED __attribute__((packed))
#endif
const char *file_remote = args->file_remote;
char *val, *end;
bool rollover;
+ unsigned rx_timeout = MAX(args->rx_timeout / 200, 1);
sock = -1;
ret = -1;
xperror("inet_addr");
goto cleanup;
}
+
addr.sin_port = htons(args->port);
blksize = 512;
}
}
- ret = tftp_recvfrom(sock, rx, &port, args->rx_timeout, blksize + 4);
+ ret = tftp_recvfrom(sock, rx, &port, rx_timeout, blksize + 4);
if (ret < 0) {
goto cleanup;
} else if (!ret) {