Skip to content

Commit

Permalink
Don't compare nodeDB macaddr to owner.macaddr, because in rare cases …
Browse files Browse the repository at this point in the history
…that may be unset. (#4562)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
  • Loading branch information
jp-bennett and thebentern authored Aug 27, 2024
1 parent b9a8683 commit ada61ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void NodeDB::pickNewNodeNum()

meshtastic_NodeInfoLite *found;
while ((nodeNum == NODENUM_BROADCAST || nodeNum < NUM_RESERVED) ||
((found = getMeshNode(nodeNum)) && memcmp(found->user.macaddr, owner.macaddr, sizeof(owner.macaddr)) != 0)) {
((found = getMeshNode(nodeNum)) && memcmp(found->user.macaddr, ourMacAddr, sizeof(ourMacAddr)) != 0)) {
NodeNum candidate = random(NUM_RESERVED, LONG_MAX); // try a new random choice
LOG_WARN("NOTE! Our desired nodenum 0x%x is invalid or in use, so trying for 0x%x\n", nodeNum, candidate);
nodeNum = candidate;
Expand Down

0 comments on commit ada61ae

Please sign in to comment.