@@ -591,19 +591,20 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)
591
591
skipHandle = true ;
592
592
}
593
593
594
+ bool shouldIgnoreNonstandardPorts =
595
+ config.device .rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_CORE_PORTNUMS_ONLY;
594
596
#if USERPREFS_EVENT_MODE
595
- if (p-> which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
596
- (p-> decoded . portnum == meshtastic_PortNum_ATAK_FORWARDER || p-> decoded . portnum == meshtastic_PortNum_ATAK_PLUGIN ||
597
- p->decoded . portnum == meshtastic_PortNum_PAXCOUNTER_APP || p-> decoded . portnum == meshtastic_PortNum_IP_TUNNEL_APP ||
598
- p->decoded .portnum == meshtastic_PortNum_AUDIO_APP || p-> decoded . portnum == meshtastic_PortNum_PRIVATE_APP ||
599
- p-> decoded . portnum == meshtastic_PortNum_DETECTION_SENSOR_APP ||
600
- p-> decoded . portnum == meshtastic_PortNum_RANGE_TEST_APP ||
601
- p-> decoded . portnum == meshtastic_PortNum_REMOTE_HARDWARE_APP)) {
602
- LOG_DEBUG (" Ignoring packet on blacklisted portnum during event " );
597
+ shouldIgnoreNonstandardPorts = true ;
598
+ # endif
599
+ if (shouldIgnoreNonstandardPorts && p->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
600
+ IS_ONE_OF ( p->decoded .portnum , meshtastic_PortNum_ATAK_FORWARDER, meshtastic_PortNum_ATAK_PLUGIN,
601
+ meshtastic_PortNum_PAXCOUNTER_APP, meshtastic_PortNum_IP_TUNNEL_APP, meshtastic_PortNum_AUDIO_APP,
602
+ meshtastic_PortNum_PRIVATE_APP, meshtastic_PortNum_DETECTION_SENSOR_APP, meshtastic_PortNum_RANGE_TEST_APP,
603
+ meshtastic_PortNum_REMOTE_HARDWARE_APP)) {
604
+ LOG_DEBUG (" Ignoring packet on blacklisted portnum for CORE_PORTNUMS_ONLY " );
603
605
cancelSending (p->from , p->id );
604
606
skipHandle = true ;
605
607
}
606
- #endif
607
608
} else {
608
609
printPacket (" packet decoding failed or skipped (no PSK?)" , p);
609
610
}
0 commit comments