mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-06-07 02:11:38 +00:00
* simplified the new flood.max.unscoped pref
This commit is contained in:
@@ -283,12 +283,8 @@ uint32_t MyMesh::getDirectRetransmitDelay(const mesh::Packet *packet) {
|
||||
bool MyMesh::allowPacketForward(const mesh::Packet *packet) {
|
||||
if (_prefs.disable_fwd) return false;
|
||||
if (packet->isRouteFlood()) {
|
||||
uint8_t limit = _prefs.flood_max;
|
||||
if (packet->getRouteType() == ROUTE_TYPE_FLOOD
|
||||
&& _prefs.flood_max_unscoped != FLOOD_MAX_UNSCOPED_UNSET) {
|
||||
limit = _prefs.flood_max_unscoped;
|
||||
}
|
||||
if (packet->getPathHashCount() >= limit) return false;
|
||||
if (packet->getPathHashCount() >= _prefs.flood_max) return false;
|
||||
if (packet->getRouteType() == ROUTE_TYPE_FLOOD && packet->getPathHashCount() >= _prefs.flood_max_unscoped) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -650,7 +646,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
|
||||
_prefs.advert_interval = 1; // default to 2 minutes for NEW installs
|
||||
_prefs.flood_advert_interval = 47; // 47 hours
|
||||
_prefs.flood_max = 64;
|
||||
_prefs.flood_max_unscoped = FLOOD_MAX_UNSCOPED_UNSET;
|
||||
_prefs.flood_max_unscoped = 64;
|
||||
_prefs.interference_threshold = 0; // disabled
|
||||
#ifdef ROOM_PASSWORD
|
||||
StrHelper::strncpy(_prefs.guest_password, ROOM_PASSWORD, sizeof(_prefs.guest_password));
|
||||
|
||||
Reference in New Issue
Block a user