Fix MAC_from_string to use input parameter instead of global config for MAC address parsing#10356
Merged
Merged
Conversation
…or MAC address parsing
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Portduino’s MAC_from_string() so it parses the MAC from its input argument (after colon stripping) instead of incorrectly reading from the global portduino_config.mac_address, and adds a regression test suite to prevent reintroducing this behavior.
Changes:
- Correct
MAC_from_string()to parse bytes from the function parametermac_strrather thanportduino_config.mac_address. - Add a new Unity test suite covering happy paths, regression cases, and length-based rejection behavior for
MAC_from_string().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/platform/portduino/PortduinoGlue.cpp |
Fixes MAC parsing to use the provided input string rather than global config state. |
test/test_mac_from_string/test_main.cpp |
Adds regression/unit tests validating correct parsing and non-parsing rejection cases. |
jp-bennett
approved these changes
Apr 30, 2026
Collaborator
|
This was a definite case of it-works-on-my-machine. Good hardening |
jp-bennett
pushed a commit
that referenced
this pull request
May 4, 2026
…or MAC address parsing (#10356) * Fix MAC_from_string to use input parameter instead of global config for MAC address parsing * Enhance MAC_from_string validation and error handling * Add missing include for <cctype> in PortduinoGlue.cpp
Evil8it
pushed a commit
to Evil8it/ME4TACTNK
that referenced
this pull request
Jun 10, 2026
…or MAC address parsing (meshtastic#10356) * Fix MAC_from_string to use input parameter instead of global config for MAC address parsing * Enhance MAC_from_string validation and error handling * Add missing include for <cctype> in PortduinoGlue.cpp
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.
This seems like a pretty big oversight. Ran into it while doing testing my TCP connection on the local MCP server on MacOS native