[OpenWrt-Devel] [PATCH] Fix: A disabled wireless network may be shown as enabled, when multiple networks are defined on the same radio
George Valkov
gvalkov at abv.bg
Fri Jul 24 12:11:28 EDT 2015
From def1b0cccf358a89131088710ac91d690d91bdf2 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Sat, 18 Jul 2015 02:28:54 +0300 Subject: [PATCH] Fix: A disabled wireless network may be shown as enabled,
when multiple networks are defined on the same radio.
---
modules/luci-base/luasrc/tools/status.lua
| 4 +++-
.../luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm
| 2 +-
modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm | 2 +-
modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
| 2 +-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/luci-base/luasrc/tools/status.lua b/modules/luci-base/luasrc/tools/status.lua index 6e588fe..299c8f5 100644 --- a/modules/luci-base/luasrc/tools/status.lua +++ b/modules/luci-base/luasrc/tools/status.lua @@ -120,7 +120,9 @@ function wifi_networks()
assoclist
= net:assoclist(),
country
= net:country(),
txpower
= net:txpower(), - txpoweroff = net:txpower_offset() + txpoweroff = net:txpower_offset(), + disabled
= (dev:get("disabled") == "1" or +
net:get("disabled") == "1")
}
end
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm index b7c44f9..4fc268e 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -183,7 +183,7 @@
for( var i = 0; i
{
var iw = st[i]; - var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown'); + var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown' && !iw.disabled);
var p = iw.quality;
var q = is_assoc ? p : -1;
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm index 2484fd3..fa0a97b 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm @@ -6,7 +6,7 @@
{
if (iw && (iw = iw[0]))
{ - var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel); + var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && !iw.disabled);
var p = iw.quality;
var q = is_assoc ? p : -1;
diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm index 548b22d..07a96b2 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm @@ -352,7 +352,7 @@
for (var nidx = 0; nidx
{
var net = dev.networks[nidx]; - var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel); + var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled);
var icon;
if (!is_assoc) --
1.9.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150724/244ea68b/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list