<HTML><BODY>
<div>From def1b0cccf358a89131088710ac91d690d91bdf2 Mon Sep 17 00:00:00 2001</div><div>From: Georgi Valkov <gvalkov@abv.bg></div><div>Date: Sat, 18 Jul 2015 02:28:54 +0300</div><div>Subject: [PATCH] Fix: A disabled wireless network may be shown as enabled,</div><div> when multiple networks are defined on the same radio.</div><div><br></div><div>---</div><div> modules/luci-base/luasrc/tools/status.lua                             | 4 +++-</div><div> .../luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm   | 2 +-</div><div> modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm | 2 +-</div><div> modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm        | 2 +-</div><div> 4 files changed, 6 insertions(+), 4 deletions(-)</div><div><br></div><div>diff --git a/modules/luci-base/luasrc/tools/status.lua b/modules/luci-base/luasrc/tools/status.lua</div><div>index 6e588fe..299c8f5 100644</div><div>--- a/modules/luci-base/luasrc/tools/status.lua</div><div>+++ b/modules/luci-base/luasrc/tools/status.lua</div><div>@@ -120,7 +120,9 @@ function wifi_networks()</div><div> <span class="Apple-tab-span" style="white-space:pre">                         </span>assoclist  = net:assoclist(),</div><div> <span class="Apple-tab-span" style="white-space:pre">                             </span>country    = net:country(),</div><div> <span class="Apple-tab-span" style="white-space:pre">                          </span>txpower    = net:txpower(),</div><div>-<span class="Apple-tab-span" style="white-space:pre">                               </span>txpoweroff = net:txpower_offset()</div><div>+<span class="Apple-tab-span" style="white-space:pre">                           </span>txpoweroff = net:txpower_offset(),</div><div>+<span class="Apple-tab-span" style="white-space:pre">                          </span>disabled   = (dev:get("disabled") == "1" or</div><div>+<span class="Apple-tab-span" style="white-space:pre">                                </span>              net:get("disabled") == "1")</div><div> <span class="Apple-tab-span" style="white-space:pre">                       </span>}</div><div> <span class="Apple-tab-span" style="white-space:pre">              </span>end</div><div> </div><div>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</div><div>index b7c44f9..4fc268e 100644</div><div>--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm</div><div>+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_overview.htm</div><div>@@ -183,7 +183,7 @@</div><div> <span class="Apple-tab-span" style="white-space:pre">                            </span>for( var i = 0; i < st.length; i++ )</div><div> <span class="Apple-tab-span" style="white-space:pre">                                </span>{</div><div> <span class="Apple-tab-span" style="white-space:pre">                                      </span>var iw = st[i];</div><div>-<span class="Apple-tab-span" style="white-space:pre">                                     </span>var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown');</div><div>+<span class="Apple-tab-span" style="white-space:pre">                                 </span>var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && iw.mode != 'Unknown' && !iw.disabled);</div><div> <span class="Apple-tab-span" style="white-space:pre">                                    </span>var p = iw.quality;</div><div> <span class="Apple-tab-span" style="white-space:pre">                                    </span>var q = is_assoc ? p : -1;</div><div> </div><div>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</div><div>index 2484fd3..fa0a97b 100644</div><div>--- a/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm</div><div>+++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/wifi_status.htm</div><div>@@ -6,7 +6,7 @@</div><div> <span class="Apple-tab-span" style="white-space:pre">         </span>{</div><div> <span class="Apple-tab-span" style="white-space:pre">                      </span>if (iw && (iw = iw[0]))</div><div> <span class="Apple-tab-span" style="white-space:pre">                        </span>{</div><div>-<span class="Apple-tab-span" style="white-space:pre">                           </span>var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel);</div><div>+<span class="Apple-tab-span" style="white-space:pre">                         </span>var is_assoc = (iw.bssid && iw.bssid != '00:00:00:00:00:00' && iw.channel && !iw.disabled);</div><div> <span class="Apple-tab-span" style="white-space:pre">                            </span>var p = iw.quality;</div><div> <span class="Apple-tab-span" style="white-space:pre">                            </span>var q = is_assoc ? p : -1;</div><div> </div><div>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</div><div>index 548b22d..07a96b2 100644</div><div>--- a/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm</div><div>+++ b/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm</div><div>@@ -352,7 +352,7 @@</div><div> <span class="Apple-tab-span" style="white-space:pre">                                 </span>for (var nidx = 0; nidx < dev.networks.length; nidx++)</div><div> <span class="Apple-tab-span" style="white-space:pre">                                      </span>{</div><div> <span class="Apple-tab-span" style="white-space:pre">                                              </span>var net = dev.networks[nidx];</div><div>-<span class="Apple-tab-span" style="white-space:pre">                                               </span>var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel);</div><div>+<span class="Apple-tab-span" style="white-space:pre">                                           </span>var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled);</div><div> </div><div> <span class="Apple-tab-span" style="white-space:pre">                                                </span>var icon;</div><div> <span class="Apple-tab-span" style="white-space:pre">                                              </span>if (!is_assoc)</div><div>-- </div><div>1.9.1</div><div><br></div></BODY></HTML>