Skip to content

Commit

Permalink
Fix rebroadcasting encrypted packets when KNOWN_ONLY or `LOCAL_ONLY…
Browse files Browse the repository at this point in the history
…` is used (#5109)
  • Loading branch information
GUVWAF authored and caveman99 committed Nov 3, 2024
1 parent 434b1c6 commit 9274f45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/RoutingModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ RoutingModule *routingModule;

bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Routing *r)
{
printPacket("Routing sniffing", &mp);
router->sniffReceived(&mp, r);

bool maybePKI = mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag && mp.channel == 0 && !isBroadcast(mp.to);
// Beginning of logic whether to drop the packet based on Rebroadcast mode
if (mp.which_payload_variant == meshtastic_MeshPacket_encrypted_tag &&
Expand All @@ -25,6 +22,9 @@ bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mesh
return false;
}

printPacket("Routing sniffing", &mp);
router->sniffReceived(&mp, r);

// FIXME - move this to a non promsicious PhoneAPI module?
// Note: we are careful not to send back packets that started with the phone back to the phone
if ((isBroadcast(mp.to) || isToUs(&mp)) && (mp.from != 0)) {
Expand Down

0 comments on commit 9274f45

Please sign in to comment.