-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Support fully direct request/responses #9455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,8 @@ uint8_t RoutingModule::getHopLimitForResponse(const meshtastic_MeshPacket &mp) | |
| #if !(EVENTMODE) // This falls through to the default. | ||
| return hopsUsed; // If the request used more hops than the limit, use the same amount of hops | ||
| #endif | ||
| } else if (mp.hop_start == 0) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to double check but since we're in an if-statement with |
||
| return 0; // The requesting node wanted 0 hops, so the response also uses a direct/local path. | ||
| } else if ((uint8_t)(hopsUsed + 2) < config.lora.hop_limit) { | ||
| return hopsUsed + 2; // Use only the amount of hops needed with some margin as the way back may be different | ||
| } | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions "asks for acks on broadcast" but the condition doesn't check if the packet is a broadcast. According to the comment's logic, this code should only apply when the packet is a broadcast (to ensure the first node that receives it will rebroadcast). For unicast packets with want_ack and hop_limit==0, the user likely wants a direct 0-hop message, which is the goal of this PR.
Consider adding a broadcast check to match the comment:
This would ensure that unicast 0-hop requests from users are honored as direct messages, while broadcast messages with want_ack still use the default hop limit as intended.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though the comment mentions broadcasts, I'm hesitant to make this change in this PR. The original logic where the comment was copied from didn't check for broadcasts, and I'd like to keep this PR scoped to the 0 hop replies.
It's also not super clear to me that the 'broadcast' in the comment is intended to refer to "the
^allTo address". I suspect it is referring to a message "transmitted/broadcast over RF/LoRA".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's keep it like it was before, although there will be a "real ACK" that will stop retransmissions if the DM reaches the recipient even with 0 hops.