diff options
author | Jo-Philipp Wich <jo@mein.io> | 2016-08-04 11:40:34 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2016-08-04 11:45:30 +0200 |
commit | 123f14b55d8ec80a8fdd328daad51a7b1532da06 (patch) | |
tree | 3fdae077d3d8dfefd2ae992374572006ea837b17 /modules/luci-base | |
parent | 240b8c4b6e5597f3f89f4382df49c123ab114c46 (diff) |
luci-base: fix handling of monitor ifaces
Wireless monitor interfaces usually have no SSID set in their config and
various network model utility functions did not handle this case properly,
mainly while trying to incorperate the SSID string into various description
labels.
Fall back to the internal network id (radioX.networkY) in cases where neither
the SSID nor the BSSID are available.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/model/network.lua | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 9cd7c87c0c..1f0c5da73a 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -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 |