Skip to content

Router: demote cross-channel decrypt failures from ERROR to DEBUG#10259

Merged
thebentern merged 1 commit into
meshtastic:developfrom
nightjoker7:fix/router-decrypt-fail-log-level
Apr 23, 2026
Merged

Router: demote cross-channel decrypt failures from ERROR to DEBUG#10259
thebentern merged 1 commit into
meshtastic:developfrom
nightjoker7:fix/router-decrypt-fail-log-level

Conversation

@nightjoker7
Copy link
Copy Markdown
Contributor

Summary

The "Invalid protobufs (bad psk?)" and "Invalid portnum (bad psk?)" messages in src/mesh/Router.cpp:502-504 fire whenever a neighbor transmits on a channel whose 8-bit hash collides with one of ours but the PSK differs. In RF environments with multiple mesh groups nearby this is routine — not an error.

Why this matters

The channel hash is only 8 bits (XOR-fold of name + PSK & 0xFF), so with enough neighboring mesh groups, hash collisions are inevitable. In real-world monitoring across a single 24-hour window I counted 17 distinct cross-channel hashes hitting the device, including SAR groups, MeshCA, Tango/Whiskey (NATO), and private community networks. Each of those that hash-collides with one of our configured channels triggers these two LOG_ERROR lines every single packet.

Effects:

  • Log spam drowns actual errors
  • A genuine PSK misconfiguration on your OWN channel is indistinguishable from the cross-channel noise
  • ERROR-level severity is misleading — this isn't an error, it's expected behavior when the hash check yields a false positive

Fix

Demote both to LOG_DEBUG. This matches how similar decrypt-failure paths are already treated — eg. the PKC "decrypt attempted but failed" path a few lines above uses LOG_WARN, and genuinely catastrophic paths (oversize packet, pb_decode fatal) use LOG_ERROR. Also drops the trailing "!" since these are expected events.

Test plan

  • Grep confirms no other paths depend on these specific LOG_ERROR messages
  • Build + run near neighboring mesh groups — expect log volume at INFO level to drop meaningfully
  • Verify that same-channel PSK mismatch (genuine config error) still surfaces in LOG_DEBUG output when enabled

Related

Part of an ongoing log-hygiene sweep. Related: #10255 (missed RX_DONE WARN→DEBUG, same spirit).

The "Invalid protobufs (bad psk?)" and "Invalid portnum (bad psk?)"
messages fire every time a neighbor transmits on a channel whose
8-bit hash matches one of ours but the PSK differs. In RF environments
with multiple mesh groups nearby this is routine — a single device
can see dozens of these per minute from SAR/MeshCA/private networks
sharing a hash collision.

LOG_ERROR for a benign "not our PSK" event:
- spams the log when you have any neighboring mesh group
- makes a genuine PSK misconfiguration on YOUR own channel
  indistinguishable from the constant cross-channel noise
- hides actual errors in the stream

LOG_DEBUG matches how similar decryption-failure paths are handled
elsewhere (eg. the PKC "decrypt attempted but failed" uses LOG_WARN).
Dropping the trailing "!" as well — these are expected events, not
exceptional ones.
@github-actions github-actions Bot added the enhancement New feature or request label Apr 23, 2026
@thebentern thebentern merged commit 399dde0 into meshtastic:develop Apr 23, 2026
3 checks passed
nightjoker7 added a commit to nightjoker7/firmware that referenced this pull request Apr 23, 2026
…shtastic#10259)

The "Invalid protobufs (bad psk?)" and "Invalid portnum (bad psk?)"
messages fire every time a neighbor transmits on a channel whose
8-bit hash matches one of ours but the PSK differs. In RF environments
with multiple mesh groups nearby this is routine — a single device
can see dozens of these per minute from SAR/MeshCA/private networks
sharing a hash collision.

LOG_ERROR for a benign "not our PSK" event:
- spams the log when you have any neighboring mesh group
- makes a genuine PSK misconfiguration on YOUR own channel
  indistinguishable from the constant cross-channel noise
- hides actual errors in the stream

LOG_DEBUG matches how similar decryption-failure paths are handled
elsewhere (eg. the PKC "decrypt attempted but failed" uses LOG_WARN).
Dropping the trailing "!" as well — these are expected events, not
exceptional ones.
mariotti pushed a commit to mariotti/firmware that referenced this pull request May 6, 2026
…shtastic#10259)

The "Invalid protobufs (bad psk?)" and "Invalid portnum (bad psk?)"
messages fire every time a neighbor transmits on a channel whose
8-bit hash matches one of ours but the PSK differs. In RF environments
with multiple mesh groups nearby this is routine — a single device
can see dozens of these per minute from SAR/MeshCA/private networks
sharing a hash collision.

LOG_ERROR for a benign "not our PSK" event:
- spams the log when you have any neighboring mesh group
- makes a genuine PSK misconfiguration on YOUR own channel
  indistinguishable from the constant cross-channel noise
- hides actual errors in the stream

LOG_DEBUG matches how similar decryption-failure paths are handled
elsewhere (eg. the PKC "decrypt attempted but failed" uses LOG_WARN).
Dropping the trailing "!" as well — these are expected events, not
exceptional ones.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants