fix: evaluate pre-hop hop_start bitfield guard post-decode instead of before decryption (#10758)

This commit is contained in:
Thomas Göttgens
2026-07-11 12:10:25 -05:00
committed by GitHub
parent c5355641d3
commit 7a25ffd0a2
3 changed files with 22 additions and 9 deletions
+4 -1
View File
@@ -156,7 +156,10 @@ inline bool shouldDropPacketForPreHop(const meshtastic_MeshPacket &p)
if (isFromUs(&p)) {
return false; // local-originated packets should never be dropped by pre-hop drop policy
}
return classifyHopStart(p) != HopStartStatus::VALID;
// Pre-decode: the channel-encrypted bitfield isn't readable yet, so a missing/unknown hop_start can't be
// distinguished from a modern packet. Only drop the provably-corrupt case here; the bitfield-dependent
// verdict is re-checked post-decode in Router::handleReceived.
return classifyHopStart(p) == HopStartStatus::INVALID;
#endif
}