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