Short circuit invalid nodenum check in ham mode.#10666
Open
vidplace7 wants to merge 1 commit into
Open
Conversation
Until signing is implemented, this will prevent the nodenum from being regenerated upon each reboot.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a ham-mode (licensed mode) boot-time behavior in NodeDB::pickNewNodeNum() where the device’s nodenum can be incorrectly considered “in use” and thus regenerated on every reboot, due to the public-key-based identity check not being applicable in ham mode.
Changes:
- Add comments clarifying that the public-key identity check is not valid when
owner.is_licensed=true(ham mode). - Skip the NodeDB/public-key collision check in ham mode to avoid repeated nodenum regeneration.
Comment on lines
+1555
to
1565
| // Short circuit the check for licensed devices since they do not have public keys to compare against the nodeDB. | ||
| if (!owner.is_licensed) { | ||
| meshtastic_NodeInfoLite *found; | ||
| while (((found = getMeshNode(nodeNum)) && !isOurOwnEntry(found)) || | ||
| (nodeNum == NODENUM_BROADCAST || nodeNum < NUM_RESERVED)) { | ||
| NodeNum candidate = random(NUM_RESERVED, LONG_MAX); // try a new random choice | ||
| if (found) | ||
| LOG_WARN("NOTE! Our desired nodenum 0x%x is invalid or in use, picking 0x%x", nodeNum, candidate); | ||
| nodeNum = candidate; | ||
| } | ||
| } |
Xaositek
approved these changes
Jun 10, 2026
Contributor
Firmware Size Report21 targets | no baseline available yet
Show 16 more target(s)
Updated for 8b45e8a |
Member
Author
|
This is still needed even after the fix in 309d51a @thebentern |
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.
Currently when ham_mode is enabled, the nodenum is declared invalid and regenerated upon every reboot because
isOurOwnEntryuses the publicKey (which doesn't exist in ham mode).This PR short circuits the invalid nodenum check when ham mode is enabled. Until signing #10478 is implemented, this will prevent the nodenum from being regenerated upon each reboot.
🤝 Attestations
tbeam-s3-core144mhz