X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Fmodel%2Fnetwork.lua;h=1f0c5da73a227b81faffbc12339e7566c265da92;hp=741daa48169759b2cf6ca71d73bf052220fce640;hb=123f14b55d8ec80a8fdd328daad51a7b1532da06;hpb=57e58b9bf9e9bbf4eeed0daf0515280376d7e611 diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 741daa481..1f0c5da73 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -22,7 +22,7 @@ module "luci.model.network" IFACE_PATTERNS_VIRTUAL = { } -IFACE_PATTERNS_IGNORE = { "^wmaster%d", "^wifi%d", "^hwsim%d", "^imq%d", "^ifb%d", "^mon%.wlan%d", "^sit%d", "^gre%d", "^lo$" } +IFACE_PATTERNS_IGNORE = { "^wmaster%d", "^wifi%d", "^hwsim%d", "^imq%d", "^ifb%d", "^mon%.wlan%d", "^sit%d", "^gre%d", "^gretap%d", "^ip6gre%d", "^ip6tnl%d", "^tunl%d", "^lo$" } IFACE_PATTERNS_WIRELESS = { "^wlan%d", "^wl%d", "^ath%d", "^%w+%.network%d" } @@ -190,7 +190,7 @@ function _iface_ignore(x) return true end end - return _iface_virtual(x) + return false end @@ -216,7 +216,7 @@ function init(cursor) _tunnel[name] = true end - if _tunnel[name] or not _iface_ignore(name) then + if _tunnel[name] or not (_iface_ignore(name) or _iface_virtual(name)) then _interfaces[name] = _interfaces[name] or { idx = i.ifindex or n, name = name, @@ -500,7 +500,7 @@ function get_interfaces(self) _uci:foreach("network", "interface", function(s) for iface in utl.imatch(s.ifname) do - if not _iface_ignore(iface) and not _wifi_iface(iface) then + if not _iface_ignore(iface) and not _iface_virtual(iface) and not _wifi_iface(iface) then seen[iface] = true nfs[iface] = interface(iface) end @@ -508,7 +508,7 @@ function get_interfaces(self) end) for iface in utl.kspairs(_interfaces) do - if not (seen[iface] or _iface_ignore(iface) or _wifi_iface(iface)) then + if not (seen[iface] or _iface_ignore(iface) or _iface_virtual(iface) or _wifi_iface(iface)) then nfs[iface] = interface(iface) end end @@ -1140,10 +1140,7 @@ end function interface.shortname(self) if self.wif then - return "%s %q" %{ - self.wif:active_mode(), - self.wif:active_ssid() or self.wif:active_bssid() - } + return self.wif:shortname() else return self.ifname end @@ -1154,7 +1151,7 @@ function interface.get_i18n(self) return "%s: %s %q" %{ lng.translate("Wireless Network"), self.wif:active_mode(), - self.wif:active_ssid() or self.wif:active_bssid() + self.wif:active_ssid() or self.wif:active_bssid() or self.wif:id() } else return "%s: %q" %{ self:get_type_i18n(), self:name() } @@ -1593,7 +1590,7 @@ end function wifinet.shortname(self) return "%s %q" %{ lng.translate(self:active_mode()), - self:active_ssid() or self:active_bssid() + self:active_ssid() or self:active_bssid() or self:id() } end @@ -1601,7 +1598,7 @@ function wifinet.get_i18n(self) return "%s: %s %q (%s)" %{ lng.translate("Wireless Network"), lng.translate(self:active_mode()), - self:active_ssid() or self:active_bssid(), + self:active_ssid() or self:active_bssid() or self:id(), self:ifname() } end