luci-base: network.js: ignore wireless ifname patterns on retrieving devices
authorJo-Philipp Wich <[email protected]>
Wed, 10 Nov 2021 10:51:42 +0000 (11:51 +0100)
committerJo-Philipp Wich <[email protected]>
Wed, 10 Nov 2021 10:57:43 +0000 (11:57 +0100)
Only treat the given identifier as Linux netdev name if we can find a
corresponding entry in the device info cache and do not consider strings
starting with "wlan", "ath" or "wl" to be existing devices.

This fixes incorrectly adding wireless sections as ifnames to network
interfaces when the wifi-iface section name begins with one of the
`iface_patterns_wireless` patterns.

Fixes: #5069
Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/htdocs/luci-static/resources/network.js

index 2a402bcd57e733ce2267c7633e24199f18293550..8c9ee255ff0ecc84ed2cb67b9ff256f62dae535e 100644 (file)
@@ -1149,7 +1149,7 @@ Network = baseclass.extend(/** @lends LuCI.network.prototype */ {
                        if (name == null)
                                return null;
 
-                       if (_state.netdevs.hasOwnProperty(name) || isWifiIfname(name))
+                       if (_state.netdevs.hasOwnProperty(name))
                                return this.instantiateDevice(name);
 
                        var netid = getWifiNetidBySid(name);