From 61e0d0176c932820a9215cbecbefa8c7183c468b Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Fri, 29 Nov 2024 16:37:53 +0100 Subject: [PATCH] Remove "Ignoring extra upload request" path --- nmrp.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/nmrp.c b/nmrp.c index a6b8f99..0b24242 100644 --- a/nmrp.c +++ b/nmrp.c @@ -675,19 +675,13 @@ int nmrp_do(struct nmrpd_args *args) break; case NMRP_C_TFTP_UL_REQ: - if (!upload_ok) { - if (++ulreqs > 5) { - printf("Bailing out after %d upload requests.\n", - ulreqs); - tx.msg.code = NMRP_C_CLOSE_REQ; - break; - } - } else { + if (++ulreqs > 1) { args->maybe_invalid_firmware_file = true; - if (verbosity) { - printf("Ignoring extra upload request.\n"); - } - ethsock_set_timeout(sock, args->ul_timeout); + } + + if (ulreqs > NMRP_MAX_UL_REQS) { + printf("Bailing out after %d upload requests.\n", ulreqs); + tx.msg.code = NMRP_C_CLOSE_REQ; break; }