sniffReceived now allows router to inspect packets not destined for this node

This commit is contained in:
geeksville
2020-05-18 17:57:58 -07:00
parent 26d3ef529e
commit 976bdad067
7 changed files with 52 additions and 28 deletions

View File

@@ -29,6 +29,7 @@ void FloodingRouter::handleReceived(MeshPacket *p)
DEBUG_MSG("Ignoring incoming msg, because we've already seen it\n");
packetPool.release(p);
} else {
// If a broadcast, possibly _also_ send copies out into the mesh. (FIXME, do something smarter than naive flooding here)
if (p->to == NODENUM_BROADCAST && p->hop_limit > 0) {
if (p->id != 0) {
MeshPacket *tosend = packetPool.allocCopy(*p); // keep a copy because we will be sending it