Tryfix nohop

This commit is contained in:
Jonathan Bennett
2026-01-12 23:17:14 -06:00
parent 8b8c1881a8
commit 5633848d75
2 changed files with 12 additions and 7 deletions

View File

@@ -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) {

View File

@@ -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);