From 97ae349fbe8ddc39385d3ee0cdfec1acbbb965ad Mon Sep 17 00:00:00 2001 From: Eric Shu <45149431+ericshu6@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:14:32 -0800 Subject: [PATCH 1/4] Update README.md: Add RAX75 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2de49e4..124e0cd 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ nmrpflash - Netgear Unbrick Utility `nmrpflash` uses Netgear's [NMRP protocol](https://web.archive.org/web/www.chubb.wattle.id.au/PeterChubb/nmrp.html) to flash a new firmware image to a compatible device. It has been successfully tested with various models (D7000, DNG3700v2, EX2700, EX6100v2, EX6120, EX6150v2, EX8000, R6020, R6080, R6100, R6220, R6400, R7000, -R7000P, R6800, R8000, R8000P, R8500, RAX40, RBR40, RBS40, RBR50, RBS50, SRR60, SRS60, WAX202, WNDR3800, WNDR4300, WNDR4500v3, +R7000P, R6800, R8000, R8000P, R8500, RAX40, RAX75, RBR40, RBS40, RBR50, RBS50, SRR60, SRS60, WAX202, WNDR3800, WNDR4300, WNDR4500v3, WNDR4700, WNR3500), but is likely to be compatible with most other Netgear devices as well. Prebuilt binaries for Linux, macOS and Windows are available [here](https://github.com/jclehner/nmrpflash/releases/latest) From 4a10c53b1a2826f616f3a9431d0f8ef13caef98c Mon Sep 17 00:00:00 2001 From: Eric Shu <45149431+ericshu6@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:39:12 -0800 Subject: [PATCH 2/4] Increase time to wait for Ethernet connection --- nmrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmrp.c b/nmrp.c index 2f79e78..8a8a46f 100644 --- a/nmrp.c +++ b/nmrp.c @@ -497,7 +497,7 @@ int nmrp_do(struct nmrpd_args *args) bool unplugged = true; time_t beg = time_monotonic(); - while (!g_interrupted && (time_monotonic() - beg) < 20) { + while (!g_interrupted && (time_monotonic() - beg) < 60) { if (!ethsock_is_unplugged(sock)) { unplugged = false; break; From 25945b162d878f083f36d354886567529e30c2bb Mon Sep 17 00:00:00 2001 From: Eric Shu <45149431+ericshu6@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:17:58 -0800 Subject: [PATCH 3/4] Define NMRP_ETH_TIMEOUT_S constant and use it in Ethernet connection timeout logic --- nmrp.c | 2 +- nmrpd.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nmrp.c b/nmrp.c index 8a8a46f..eaa73b5 100644 --- a/nmrp.c +++ b/nmrp.c @@ -497,7 +497,7 @@ int nmrp_do(struct nmrpd_args *args) bool unplugged = true; time_t beg = time_monotonic(); - while (!g_interrupted && (time_monotonic() - beg) < 60) { + while (!g_interrupted && (time_monotonic() - beg) < NMRP_ETH_TIMEOUT_S) { if (!ethsock_is_unplugged(sock)) { unplugged = false; break; diff --git a/nmrpd.h b/nmrpd.h index c64c14d..da9b817 100644 --- a/nmrpd.h +++ b/nmrpd.h @@ -84,6 +84,8 @@ #define NMRP_DEFAULT_SUBNET "255.255.255.0" #define NMRP_DEFAULT_TFTP_PORT 69 +#define NMRP_ETH_TIMEOUT_S 60 + struct eth_hdr { uint8_t ether_dhost[6]; uint8_t ether_shost[6]; From c85b5031319c3f3a15217f72b586ad2ebf1d8104 Mon Sep 17 00:00:00 2001 From: Eric Shu <45149431+ericshu6@users.noreply.github.com> Date: Sat, 23 Nov 2024 19:20:52 -0800 Subject: [PATCH 4/4] Use NMRP_ETH_TIMEOUT_S constant for Ethernet socket timeout --- nmrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmrp.c b/nmrp.c index eaa73b5..87798f0 100644 --- a/nmrp.c +++ b/nmrp.c @@ -540,7 +540,7 @@ int nmrp_do(struct nmrpd_args *args) } } - if (ethsock_set_timeout(sock, 20)) { + if (ethsock_set_timeout(sock, NMRP_ETH_TIMEOUT_S)) { goto out; }