diff --git a/docs/software/mesh-alg.md b/docs/software/mesh-alg.md index d4ae7121..dc4203ab 100644 --- a/docs/software/mesh-alg.md +++ b/docs/software/mesh-alg.md @@ -23,8 +23,9 @@ reliable messaging tasks (stage one for DSR): dsr tasks -- Don't use broadcasts for the network pings (close open github issue) -- add ignoreSenders to radioconfig to allow testing different mesh topologies by refusing to see certain senders +- oops I might have broken message reception +- DONE Don't use broadcasts for the network pings (close open github issue) +- DONE add ignoreSenders to radioconfig to allow testing different mesh topologies by refusing to see certain senders - test multihop delivery with the python framework optimizations / low priority: diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 1c8d1763..4a7fac5f 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -201,14 +201,16 @@ void Router::handleReceived(MeshPacket *p) void Router::perhapsHandleReceived(MeshPacket *p) { assert(radioConfig.has_preferences); - bool inIgnore = is_in_repeated(radioConfig.preferences.ignore_incoming, p->from); + bool ignore = is_in_repeated(radioConfig.preferences.ignore_incoming, p->from); - if (inIgnore) + if (ignore) DEBUG_MSG("Ignoring incoming message, 0x%x is in our ignore list\n", p->from); + else if (ignore |= shouldFilterReceived(p)) + DEBUG_MSG("Incoming message was filtered 0x%x\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)) + if (!ignore) handleReceived(p); packetPool.release(p); diff --git a/src/mesh/mesh-pb-constants.cpp b/src/mesh/mesh-pb-constants.cpp index 894afe47..86431785 100644 --- a/src/mesh/mesh-pb-constants.cpp +++ b/src/mesh/mesh-pb-constants.cpp @@ -67,7 +67,7 @@ bool writecb(pb_ostream_t *stream, const uint8_t *buf, size_t count) bool is_in_helper(uint32_t n, const uint32_t *array, pb_size_t count) { - for (int i = 0; i < count; i++) + for (pb_size_t i = 0; i < count; i++) if (array[i] == n) return true;