From 7ceebe777736347a15c0b3d6161f8de341fcdc2b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 2 Mar 2024 10:17:28 -0600 Subject: [PATCH] Filter out neighborinfo if we don't have the module enabled --- src/mesh/Router.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 4a6dc90074..3e40566aa2 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -469,8 +469,15 @@ void Router::perhapsHandleReceived(meshtastic_MeshPacket *p) // assert(radioConfig.has_preferences); bool ignore = is_in_repeated(config.lora.ignore_incoming, p->from) || (config.lora.ignore_mqtt && p->via_mqtt); + // Neighbor info module is disabled, ignore expensive neighbor info packets + if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag && + p->decoded.portnum == meshtastic_PortNum_NEIGHBORINFO_APP && + (!moduleConfig.has_neighbor_info || !moduleConfig.neighbor_info.enabled)) + ignore = true; + if (ignore) { - LOG_DEBUG("Ignoring incoming message, 0x%x is in our ignore list or came via MQTT\n", p->from); + LOG_DEBUG("Ignoring incoming message, 0x%x is in our ignore list, came via MQTT, or is on a portnum we haven't enabled\n", + p->from); } else if (ignore |= shouldFilterReceived(p)) { LOG_DEBUG("Incoming message was filtered 0x%x\n", p->from); }