Fix: Preserve forwarded position payload precision#10554
Merged
thebentern merged 1 commit intoMay 26, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the router send path so position-precision clamping is enforced only for locally originated POSITION_APP packets, preventing relays from mutating other nodes’ forwarded position payloads while preserving the privacy fix for local “Exchange Positions” traffic.
Changes:
- Gate
applyPositionPrecisionForChannel()inRouter::send()behindisFromUs(p)so relays don’t rewrite forwarded position payloads. - Retain malformed-local-position rejection before send, but only for locally originated packets.
thebentern
pushed a commit
that referenced
this pull request
May 26, 2026
Evil8it
pushed a commit
to Evil8it/ME4TACTNK
that referenced
this pull request
Jun 10, 2026
raghumad
pushed a commit
to raghumad/mezulla-firmware
that referenced
this pull request
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR narrows the position-precision enforcement added in #10383 so it applies only to position packets originated by the local node. Relayed decoded
POSITION_APPpackets are still forwarded normally, but this node no longer rewrites another node's latitude, longitude, orprecision_bitswhile rebroadcasting.The code change is very small:
This keeps the original privacy fix for locally generated direct position exchanges, while preventing relays from mutating position packets they did not originate.
Background
Issue #8640 reported that using "Exchange Positions" from the node list could send the local device's exact coordinates even when the channel had reduced position precision configured. That was a privacy problem because these "direct" position exchanges were not private PKI messages. They were normal channel-encrypted
POSITION_APPpackets with atofield, so every node that knew the channel key could decrypt them. Gateways could then publish those full-precision coordinates to MQTT.PR #10383 fixed that by centralizing position-precision handling in
PositionPrecisionand callingapplyPositionPrecisionForChannel()fromRouter::send(), after the final channel was known and before channel encryption. That was the right place to catch locally generated direct position exchanges and replies that could bypass the olderPositionModulealteration path.Regression
Router::send()is not exclusively an originator path. It is also used when a node rebroadcasts a decoded packet that it received from the mesh. When a relay has decoded a channel packet and then forwards it, the packet can still be inmeshtastic_MeshPacket_decoded_tagform as it re-enters the send path.Because #10383 applied channel precision unconditionally to any decoded
POSITION_APPinRouter::send(), a relay could apply its own local channel precision settings to another node's packet. That creates a distinctive failure mode:precision_bitsmay be left or reset to the relay's view of full precisionlatitude_iandlongitude_imay have lower bits zeroed or centered according to the relay's configured precisionFix
This PR keeps
applyPositionPrecisionForChannel()inRouter::send(), but gates it withisFromUs(p).That means:
This matches the original bug report because #8640 was about the local node leaking its own exact location when it sends a position exchange. The local node is still responsible for enforcing its configured channel precision before it transmits its own location. The only behavior removed here is applying this node's privacy policy to someone else's packet during forwarding.
The #10383 fix was correct in intent: direct position exchanges are channel-visible and must be clamped. The bug was that the implementation did not distinguish originator sends from relay sends at the
Router::send()chokepoint. AddingisFromUs(p)makes that distinction explicit without moving the precision logic back into a path that direct exchanges can bypass.🤝 Attestations
Heltec V4