Fix wireless.scandevices() crash with missing radio hardware#1226
Open
Pablomonte wants to merge 4 commits intolibremesh:masterfrom
Open
Fix wireless.scandevices() crash with missing radio hardware#1226Pablomonte wants to merge 4 commits intolibremesh:masterfrom
Pablomonte wants to merge 4 commits intolibremesh:masterfrom
Conversation
Fixes crash when UCI has radios configured but hardware is missing. scandevices() now checks if phy exists before adding radio to list. Also handles radios with non-numeric names to prevent nil arithmetic. Fixes libremesh#1225 Co-Authored-By: Claude <noreply@anthropic.com>
Adds test coverage for scandevices() and mesh_ifaces() based on production scenarios found during physical router testing: - scandevices() skips radios with missing hardware (FBW crash fix) - scandevices() handles radios without path (backward compatibility) - scandevices() works with APUP-configured radios - mesh_ifaces() includes APUP peer interfaces (wlan0-peer0, etc) Fixes test_lime_config_device.lua fs.glob stub to preserve original glob behavior for hardware detection module discovery. Without this, openwrt_wan module is not found and WAN config test fails. All tests pass: 306 successes / 0 failures AI-assisted development
Fixes password changes not persisting when using network-admin password change feature. The function was updating UCI but never committing, causing changes to be lost on reboot or config reload. The bug existed since the function was introduced in commit 606ae4c (2020). It went unnoticed because First Boot Wizard did commit after calling this function, but network-admin relies on the function to commit its own changes. Impact: Without this fix, mesh-wide password changes don't work - not even on the local node where the change is initiated. Tested: All tests pass (306 successes / 0 failures) AI-assisted development
This reverts commit b0ac255.
Member
|
We have here the first pull request written by Claude AI, seems. The people who developed FirstBootWizard should check and approve the pull request: @spiccinini is the maintainer (according to its Makefile), @selankon, @germanferrero and @gmarcos87. |
G10h4ck
reviewed
Jan 4, 2026
Member
G10h4ck
left a comment
There was a problem hiding this comment.
Thew actual code seems fine, the unit testing code seems including unrelated stuff at first glance, ain't got time to read too much AI slop
Contributor
Author
|
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.
Problem
First Boot Wizard crashes when UCI has radios configured but hardware doesn't exist
(e.g., radio2 in config but only phy0/phy1 physically present). This happens on
routers with stale UCI configs after hardware removal or PCI device changes.
Symptoms
wireless.get_phy_mac(..) failed reading: /sys/class/ieee80211/phy2/macaddressSolution
wireless.scandevices()now checks if hardware exists before including radiofs.glob()to verify/sys/devices/<path>/ieee80211/phy*existspathare included (backward compatibility for legacy configs)Testing
Tested on physical router with 2 phys + 3 UCI radios (camiba7c2).
Related Issues #1225
Fixes crash documented in testing sessions (router with stale radio2 config).
Commits
fix: skip radios without hardware in scandevices()test(wireless): add tests for hardware detection and APUP