luci-mod-network: fix uci.remove() deleting entire radio section on wifi join#8539
Merged
systemcrash merged 1 commit intoopenwrt:masterfrom Apr 10, 2026
Merged
Conversation
…ifi join
In handleJoinConfirm(), when the scanned BSS has no VHT/HT info,
uci.remove('wireless', radioDev.getName(), 'htmode') is called
intending to remove only the htmode option. However, uci.remove()
only accepts (conf, sid) and silently ignores the third parameter,
causing the entire wifi-device section to be deleted from the
rpcd session delta.
This makes the radio disappear from the Wireless Overview page
until the session delta is cleared.
Fix by using uci.unset() which correctly handles three parameters
(conf, sid, opt) to remove a single option.
Signed-off-by: Weicheng Xiao <weicheng.xiao@outlook.com>
Contributor
|
Merged. Thanks @weicheng04 |
Failed checksIssues marked with an ❌ are failing checks. Commit c1bbb05
For more details, see the full job log. Something broken? Consider providing feedback. |
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
When joining a Wi-Fi network via Scan → Join Network, if the scanned BSS
has no VHT/HE capability information (e.g. a basic 802.11b/g/n AP), the
handleJoinConfirmcallback enters theelsebranch at line 2152 and calls:The intent is to remove only the
htmodeoption. However,uci.remove()in
uci.jsonly accepts two parameters(conf, sid)— the third parameteris silently ignored. This causes the entire wifi-device section (e.g.
radio0) to be marked for deletion in the rpcd session delta.Symptoms
"This section contains no values yet"
-wireless.radio0Root Cause
uci.jsdefines:remove(conf, sid)→ deletes entire sectionunset(conf, sid, opt)→ removes a single option (callsset(conf, sid, opt, null))The code should use
uci.unset()instead ofuci.remove()when removinga single option.
Fix
Testing
Tested on OpenWrt 24.10-SNAPSHOT (aarch64, BCM43455):
uci show wirelessconfirms radio0 section is preserved