Apply wildcard deny and hop limits to zero-scope floods

This commit is contained in:
mikecarper committed 2026-10-15 17:37:54 -07:00
1 parent 755895c7e0
commit 0eace6b694
4 files changed
+93 -3

No files matched your search

+4 -1
View File
@@ -288,7 +288,10 @@ int RegionMap::getTransportKeysFor(const RegionEntry& src, TransportKey dest[],
}
RegionEntry* RegionMap::findMatch(const mesh::Packet* packet, uint8_t mask) {
if (packet->transport_codes[0] == 0) return &wildcard;
if (packet->transport_codes[0] == 0) {
// Zero means unscoped, not an exemption from the wildcard's deny policy.
return (wildcard.flags & mask) == 0 ? &wildcard : NULL;
}
for (int i = 0; i < num_regions; i++) {
auto region = &regions[i];
if ((region->flags & mask) == 0) { // does region allow this? (per 'mask' param)