Skip to content

RadioInterface::getRetransmissionMsec now handles encrypted packets c…#9184

Merged
thebentern merged 1 commit into
meshtastic:developfrom
rbreesems:getretranfix
Jan 6, 2026
Merged

RadioInterface::getRetransmissionMsec now handles encrypted packets c…#9184
thebentern merged 1 commit into
meshtastic:developfrom
rbreesems:getretranfix

Conversation

@rbreesems

Copy link
Copy Markdown
Contributor

This is a one line PR (no issue created) that changes RadioInterface::getRetransmissionMsec to handle the case of the packet being encrypted. This method is called by NextHopRouter when adding a packet for retranmssion. When the node is at least one hop away from the sending node, the packet handed to this method is encrypted.

When the packet is encrypted, the current code throws an error Panic: can't encode protobuf reason='bytes size exceeded' because of the call to pb_encode_to_bytes. When this happens whatever value that gets placed in numbytes by this method results in the packet never being retransmitted about 90% of time (at least in my tests).

The fix sets the numbytes value to the correct size of the encrypted packet if it is encrypted.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

@rbreesems rbreesems marked this pull request as draft January 5, 2026 17:01
@rbreesems rbreesems marked this pull request as ready for review January 5, 2026 18:03
@rbreesems

Copy link
Copy Markdown
Contributor Author

For some reason, I cannot add a tag to this Merge Request, should be 'bugfix'.

Also, cannot run the formatter for some reason.

@thebentern thebentern added the bugfix Pull request that fixes bugs label Jan 5, 2026
@rbreesems

Copy link
Copy Markdown
Contributor Author

I now realize that the pb_encode_to_bytes PANIC is intentional and returns 0 resulting in a packet size is just sizeof(PacketHeader). However, it is disconcerting to see PANIC error messages in the debug log and it should just return the encrypted packet size.

@GUVWAF GUVWAF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@thebentern thebentern merged commit ba9d0e6 into meshtastic:develop Jan 6, 2026
74 of 76 checks passed
vicliu624 pushed a commit to vicliu624/firmware that referenced this pull request Jan 13, 2026
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants