Skip to content

Commit

Permalink
Filter out neighborinfo if we don't have the module enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern committed Mar 2, 2024
1 parent d20fa6e commit 7ceebe7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mesh/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7ceebe7

Please sign in to comment.