meshtastic / firmware

Meshtastic device firmware
https://meshtastic.org
GNU General Public License v3.0
3.64k stars 913 forks source link

Fix non-primary channel usage for non-PKC packets #5287

Closed GUVWAF closed 2 weeks ago

GUVWAF commented 2 weeks ago

Even if we have the public key of a node, for some packets we use the legacy channels (e.g., traceroute, NodeInfo, Routing) and those should use the channel corresponding to a node. In perhapsEncode(), the channel will be set back to 0 when we do use PKC. Also this clause will still pass if the client explicitly requested PKC:

https://github.com/meshtastic/firmware/blob/439c1dec08a29beaa4939458aeb75a9924a67c74/src/mesh/Router.cpp#L497