Set last byte to 0xFF if it ended at 0x00

As per an idea of @S5NC
This commit is contained in:
GUVWAF
2023-11-27 20:36:48 +01:00
parent 81f57b65e1
commit ef2c6eed05
5 changed files with 13 additions and 10 deletions

View File

@@ -241,10 +241,10 @@ ErrorCode Router::send(meshtastic_MeshPacket *p)
p->from = getFrom(p);
// If we are the original transmitter, set the original hop limit
if (p->from == nodeDB.getNodeNum())
if (p->from == getNodeNum())
p->original_hop_limit = config.lora.hop_limit ? config.lora.hop_limit : HOP_RELIABLE;
p->relay_node = (uint8_t)(getNodeNum() & 0xFF); // set the current relayer to us
p->relay_node = nodeDB.getLastByteOfNodeNum(getNodeNum()); // set the relayer to us
// If the packet hasn't yet been encrypted, do so now (it might already be encrypted if we are just forwarding it)