Skip to content

Commit cd870fa

Browse files
committed
Route the raced loopback through handleReceived
1 parent 05c3255 commit cd870fa

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/mesh/Router.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,9 @@ void Router::deliverLocal(meshtastic_MeshPacket *p, RxSource src)
12731273
if (queued)
12741274
return;
12751275
if (!stillNested) {
1276-
// The drain finished first, so nothing would pick this up; deliver it here instead.
1277-
dispatchReceived(copy, src);
1276+
// The drain finished first, so nothing would pick this up. Go through handleReceived()
1277+
// rather than dispatchReceived() so a loopback from its modules still defers.
1278+
handleReceived(copy, src);
12781279
packetPool.release(copy);
12791280
return;
12801281
}

src/mesh/Router.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Router : protected concurrency::OSThread, protected PacketHistory
168168
* Note: some packets may merely being passed through this node and will be forwarded elsewhere.
169169
*
170170
* Note: this packet will never be called for messages sent/generated by this node.
171-
* Note: this method will free the provided packet.
171+
* Note: this does NOT free the provided packet; the caller still owns it.
172172
*/
173173
void handleReceived(meshtastic_MeshPacket *p, RxSource src = RX_SRC_RADIO);
174174

0 commit comments

Comments
 (0)