Skip to content

luci-mod-network: fix uci.remove() deleting entire radio section on wifi join#8539

Merged
systemcrash merged 1 commit intoopenwrt:masterfrom
weicheng04:fix/wireless-join-removes-radio
Apr 10, 2026
Merged

luci-mod-network: fix uci.remove() deleting entire radio section on wifi join#8539
systemcrash merged 1 commit intoopenwrt:masterfrom
weicheng04:fix/wireless-join-removes-radio

Conversation

@weicheng04
Copy link
Copy Markdown
Contributor

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
handleJoinConfirm callback enters the else branch at line 2152 and calls:

uci.remove('wireless', radioDev.getName(), 'htmode');

The intent is to remove only the htmode option. However, uci.remove()
in uci.js only accepts two parameters (conf, sid) — the third parameter
is silently ignored. This causes the entire wifi-device section (e.g.
radio0) to be marked for deletion in the rpcd session delta.

Symptoms

  • After clicking "Join Network", the Wireless Overview page shows
    "This section contains no values yet"
  • All wifi-iface entries disappear from the page
  • The rpcd session delta file contains -wireless.radio0
  • The bug persists until the user logs out or the session expires

Root Cause

uci.js defines:

  • remove(conf, sid) → deletes entire section
  • unset(conf, sid, opt) → removes a single option (calls set(conf, sid, opt, null))

The code should use uci.unset() instead of uci.remove() when removing
a single option.

Fix

-				uci.remove('wireless', radioDev.getName(), 'htmode');
+				uci.unset('wireless', radioDev.getName(), 'htmode');

Testing

Tested on OpenWrt 24.10-SNAPSHOT (aarch64, BCM43455):

  1. Network → Wireless → Scan → Join a 2.4GHz b/g/n network
  2. Wireless Overview page displays correctly after join
  3. uci show wireless confirms radio0 section is preserved

…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>
@systemcrash systemcrash merged commit 1655946 into openwrt:master Apr 10, 2026
2 of 7 checks passed
@systemcrash
Copy link
Copy Markdown
Contributor

Merged. Thanks @weicheng04

@github-actions
Copy link
Copy Markdown

Warning

Some formality checks failed.

Consider (re)reading submissions guidelines.

Failed checks

Issues marked with an ❌ are failing checks.

Commit c1bbb05

  • 🔶 Author name must be either a real name 'firstname lastname' or a nickname/alias/handle
    Actual: weicheng04 seems to be a nickname or an alias
    Expected: a real name 'firstname lastname'
  • 🔶 Commit(ter) name must be either a real name 'firstname lastname' or a nickname/alias/handle
    Actual: weicheng04 seems to be a nickname or an alias
    Expected: a real name 'firstname lastname'
  • 🔶 Commit subject must be <= 80 (and should be <= 60) characters long
    Actual: subject is 77 characters long
    $\textsf{luci-mod-network: fix uci.remove() deleting entire radio sec\color{yellow}{tion on wifi join}\color{red}{}}$
  • Signed-off-by must match author
    Actual: missing or doesn't match author
    Expected: Signed-off-by: weicheng04 <weicheng.xiao@outlook.com>

For more details, see the full job log.

Something broken? Consider providing feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants