From 259ee9864854b24a1868abc62f4e345c6bcd1617 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Mon, 28 Jul 2025 17:31:28 +1000 Subject: [PATCH] CORE_PORTNUMS_ONLY should not include ports > 255. As reported by @Ne00n and Stary, the core portnums only router forward limit still forwarded ports in the private application space. This patch removes ports above 255 from the core portnums, as this was unintended. fixes https://github.com/meshtastic/firmware/issues/7480 --- src/mesh/Router.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 02968513c..1064e8cd8 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -651,10 +651,11 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) shouldIgnoreNonstandardPorts = true; #endif if (shouldIgnoreNonstandardPorts && p->which_payload_variant == meshtastic_MeshPacket_decoded_tag && - IS_ONE_OF(p->decoded.portnum, meshtastic_PortNum_ATAK_FORWARDER, meshtastic_PortNum_ATAK_PLUGIN, - meshtastic_PortNum_PAXCOUNTER_APP, meshtastic_PortNum_IP_TUNNEL_APP, meshtastic_PortNum_AUDIO_APP, - meshtastic_PortNum_PRIVATE_APP, meshtastic_PortNum_DETECTION_SENSOR_APP, meshtastic_PortNum_RANGE_TEST_APP, - meshtastic_PortNum_REMOTE_HARDWARE_APP)) { + (IS_ONE_OF(p->decoded.portnum, meshtastic_PortNum_ATAK_FORWARDER, meshtastic_PortNum_ATAK_PLUGIN, + meshtastic_PortNum_PAXCOUNTER_APP, meshtastic_PortNum_IP_TUNNEL_APP, meshtastic_PortNum_AUDIO_APP, + meshtastic_PortNum_PRIVATE_APP, meshtastic_PortNum_DETECTION_SENSOR_APP, meshtastic_PortNum_RANGE_TEST_APP, + meshtastic_PortNum_REMOTE_HARDWARE_APP) || + p->decoded.portnum >= meshtastic_PortNum_PRIVATE_APP)) { LOG_DEBUG("Ignore packet on blacklisted portnum for CORE_PORTNUMS_ONLY"); cancelSending(p->from, p->id); skipHandle = true;