* scope 0 rule fixes
This commit is contained in:
1 parent
4d3178d82a
commit
ab64c87c38
2 files changed
+2
-1
No files matched your search
@@ -188,7 +188,7 @@ int RegionMap::getTransportKeysFor(const RegionEntry& src, TransportKey dest[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
RegionEntry* RegionMap::findMatch(mesh::Packet* packet, uint8_t mask) {
|
RegionEntry* RegionMap::findMatch(mesh::Packet* packet, uint8_t mask) {
|
||||||
if (packet->transport_codes[0] == 0) return &wildcard;
|
if (packet->transport_codes[0] == 0) return (wildcard.flags & mask) == 0 ? &wildcard : NULL;
|
||||||
for (int i = 0; i < num_regions; i++) {
|
for (int i = 0; i < num_regions; i++) {
|
||||||
auto region = ®ions[i];
|
auto region = ®ions[i];
|
||||||
if ((region->flags & mask) == 0) { // does region allow this? (per 'mask' param)
|
if ((region->flags & mask) == 0) { // does region allow this? (per 'mask' param)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ inline bool isFloodHopLimitExceeded(const Packet* packet, uint8_t flood_max,
|
|||||||
uint8_t hops = packet->getPathHashCount();
|
uint8_t hops = packet->getPathHashCount();
|
||||||
if (hops >= flood_max) return true;
|
if (hops >= flood_max) return true;
|
||||||
if (packet->getRouteType() == ROUTE_TYPE_FLOOD && hops >= flood_max_unscoped) return true;
|
if (packet->getRouteType() == ROUTE_TYPE_FLOOD && hops >= flood_max_unscoped) return true;
|
||||||
|
if (packet->getRouteType() == ROUTE_TYPE_TRANSPORT_FLOOD && packet->transport_codes[0] == 0 && hops >= flood_max_unscoped) return true; // scope 0, treat as unscoped
|
||||||
if (packet->getPayloadType() == PAYLOAD_TYPE_ADVERT && hops >= flood_max_advert) return true;
|
if (packet->getPayloadType() == PAYLOAD_TYPE_ADVERT && hops >= flood_max_advert) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user