Skip to content

Commit ae67293

Browse files
committed
Honor flood retry ignore for echoes
1 parent 3a6766b commit ae67293

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

docs/cli_commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ This document provides an overview of CLI commands that can be sent to MeshCore
850850

851851
**Default:** empty
852852

853-
**Note:** Ignored prefixes do not count as a heard bridge bucket or as the implicit catch-all bucket when bridge retry decides whether every target has repeated the flood.
853+
**Note:** In non-bridge retry, an echo whose last hop matches an ignored prefix does not cancel a queued retry as successful. In bridge mode, ignored prefixes do not count as a heard bridge bucket or as the implicit catch-all bucket when bridge retry decides whether every target has repeated the flood.
854854

855855
---
856856

examples/simple_repeater/MyMesh.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,17 @@ bool MyMesh::isFloodRetryEchoTarget(const mesh::Packet* packet, uint8_t progress
13631363
state->heard_mask |= floodRetryBridgeHeardMask(packet, state->source_bucket, state->progress_marker) & state->target_mask;
13641364
return (state->heard_mask & state->target_mask) == state->target_mask;
13651365
}
1366+
if (packet->getPathHashCount() == 0) {
1367+
return false;
1368+
}
1369+
uint8_t hash_size = packet->getPathHashSize();
1370+
if (hash_size == 0 || hash_size > MAX_ROUTE_HASH_BYTES) {
1371+
return false;
1372+
}
1373+
const uint8_t* heard_prefix = &packet->path[(packet->getPathHashCount() - 1) * hash_size];
1374+
if (floodRetryPrefixIgnored(heard_prefix, hash_size)) {
1375+
return false;
1376+
}
13661377
if (hasFloodRetryPrefixes()) {
13671378
return floodRetryLastHopMatches(packet);
13681379
}

0 commit comments

Comments
 (0)