Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mesh/Channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class Channels

bool setDefaultPresetCryptoForHash(ChannelHash channelHash);

int16_t getHash(ChannelIndex i) { return hashes[i]; }

private:
/** Given a channel index, change to use the crypto key specified by that index
*
Expand All @@ -113,8 +115,6 @@ class Channels
*/
int16_t generateHash(ChannelIndex channelNum);

int16_t getHash(ChannelIndex i) { return hashes[i]; }

/**
* Validate a channel, fixing any errors as needed
*/
Expand Down
3 changes: 2 additions & 1 deletion src/mesh/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)

// Store a copy of encrypted packet for MQTT
DEBUG_HEAP_BEFORE;
meshtastic_MeshPacket *p_encrypted = packetPool.allocCopy(*p);
p_encrypted = packetPool.allocCopy(*p);
Comment thread
jp-bennett marked this conversation as resolved.
DEBUG_HEAP_AFTER("Router::handleReceived", p_encrypted);

// Take those raw bytes and convert them back into a well structured protobuf we can understand
Expand Down Expand Up @@ -758,6 +758,7 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src)
}

packetPool.release(p_encrypted); // Release the encrypted packet
p_encrypted = nullptr;
}

void Router::perhapsHandleReceived(meshtastic_MeshPacket *p)
Expand Down
3 changes: 3 additions & 0 deletions src/mesh/Router.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class Router : protected concurrency::OSThread, protected PacketHistory
before us */
uint32_t rxDupe = 0, txRelayCanceled = 0;

// pointer to the encrypted packet
meshtastic_MeshPacket *p_encrypted = nullptr;

protected:
friend class RoutingModule;

Expand Down