From 5633848d7578deb38f93924ea8d9cd355e47e925 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 12 Jan 2026 23:17:14 -0600 Subject: [PATCH] Tryfix nohop --- src/mesh/NextHopRouter.cpp | 12 ++++++++++++ src/mesh/Router.cpp | 7 ------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/mesh/NextHopRouter.cpp b/src/mesh/NextHopRouter.cpp index 5230e5b85..93ab94a7d 100644 --- a/src/mesh/NextHopRouter.cpp +++ b/src/mesh/NextHopRouter.cpp @@ -145,6 +145,18 @@ bool NextHopRouter::perhapsRebroadcast(const meshtastic_MeshPacket *p) tosend->hop_start -= (tosend->hop_limit - 2); tosend->hop_limit = 2; } +#elif ARCH_PORTDUINO + if (tosend->which_payload_variant == meshtastic_MeshPacket_decoded_tag && + portduino_config.nohop_ports.size()) { + for (const auto &port : portduino_config.nohop_ports) { + if (port == tosend->decoded.portnum) { + LOG_DEBUG("0-hopping portnum %u", tosend->decoded.portnum); + tosend->hop_start -= tosend->hop_limit; + tosend->hop_limit = 0; + break; + } + } + } #endif if (p->next_hop == NO_NEXT_HOP_PREFERENCE) { diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 149cafe88..cb67952b7 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -757,13 +757,6 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) skipHandle = true; } } - for (const auto &port : portduino_config.nohop_ports) { - if (port == p->decoded.portnum) { - p->hop_start -= p->hop_limit; - p->hop_limit = 0; - break; - } - } #endif } else { printPacket("packet decoding failed or skipped (no PSK?)", p);