summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-05-30 00:44:04 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-05-30 00:44:04 +0000
commit44171fde222868b68a880aec8bb375a1acc0e2fc (patch)
treeb47b7bd5942f0aa09e3eaec6115e5a4049cb26be /modules/admin-full/luasrc
parent242f8edabf7e314d5403904157af18d1131f6599 (diff)
modules/admin-full: fix bridge info on interface status page if multiple bridges are present on the system
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r--modules/admin-full/luasrc/view/admin_status/interfaces.htm28
1 files changed, 17 insertions, 11 deletions
diff --git a/modules/admin-full/luasrc/view/admin_status/interfaces.htm b/modules/admin-full/luasrc/view/admin_status/interfaces.htm
index 99d5ba824..482aa0c0c 100644
--- a/modules/admin-full/luasrc/view/admin_status/interfaces.htm
+++ b/modules/admin-full/luasrc/view/admin_status/interfaces.htm
@@ -143,16 +143,22 @@ $Id$
function get_brinfo(s)
local b = { }
- for l in luci.util.execi("brctl show br-%s" % s['.name']) do
+ local m = false
+ for l in luci.util.execi("brctl show") do
if not l:match("STP") then
- local r = luci.util.split(l, "%s+", nil, true)
- if #r > 2 then
- b.name = r[1]
- b.id = r[2]
- b.stp = r[3] == "yes"
- b.ifnames = { r[4] }
- else
- b.ifnames[#b.ifnames+1] = r[2]
+ if m and l:match("^[a-z]") then
+ break
+ elseif m or l:match("^br%%-%s" % s['.name']) then
+ m = true
+ local r = luci.util.split(l, "%s+", nil, true)
+ if #r > 2 then
+ b.name = r[1]
+ b.id = r[2]
+ b.stp = r[3] == "yes"
+ b.ifnames = { r[4] }
+ else
+ b.ifnames[#b.ifnames+1] = r[2]
+ end
end
end
end
@@ -228,9 +234,9 @@ $Id$
<% for _, b in ipairs(bridge_ifs) do
br = get_brinfo(b)
- dev = br.name
+ dev = br and br.name
- if devinfo and devinfo[dev] then
+ if br and devinfo and devinfo[dev] then
%>
<h3><%:a_s_if_bridge Bridge%> <%=br.name%></h3>
<p style="font-size:90%;padding-left:1em">