add ignore_incoming to user preferences, for automated testing of DSR topologies

This commit is contained in:
geeksville
2020-05-23 10:01:36 -07:00
parent c9cb293bf2
commit 16812c3ee4
5 changed files with 39 additions and 8 deletions

View File

@@ -195,7 +195,15 @@ void Router::handleReceived(MeshPacket *p)
void Router::perhapsHandleReceived(MeshPacket *p)
{
if (!shouldFilterReceived(p))
assert(radioConfig.has_preferences);
bool inIgnore = is_in_repeated(radioConfig.preferences.ignore_incoming, p->from);
if (inIgnore)
DEBUG_MSG("Ignoring incoming message, 0x%x is in our ignore list\n", p->from);
// Note: we avoid calling shouldFilterReceived if we are supposed to ignore certain nodes - because some overrides might
// cache/learn of the existence of nodes (i.e. FloodRouter) that they should not
if (!inIgnore && !shouldFilterReceived(p))
handleReceived(p);
packetPool.release(p);