diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-07-15 17:21:02 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-07-15 17:29:01 +0200 |
commit | 4f0b755241098eba7ff1c85b7ae01bc5f512122f (patch) | |
tree | e4dce671b777ef9306fe3b47bd8975b1d6896234 /modules | |
parent | ffff1e7c0aa58991ffae5216221b8bb205f8bc78 (diff) |
luci-mod-admin-full: fix changing alias interface ifnames
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua index 5c630bb5ce..06bce01fc4 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -285,6 +285,7 @@ if not net:is_floating() then ifname_single.template = "cbi/network_ifacelist" ifname_single.widget = "radio" ifname_single.nobridges = true + ifname_single.noaliases = false ifname_single.rmempty = false ifname_single.network = arg[1] ifname_single:depends("type", "") @@ -295,12 +296,18 @@ if not net:is_floating() then end function ifname_single.write(self, s, val) - local i + local _, i local new_ifs = { } local old_ifs = { } - for _, i in ipairs(net:get_interfaces() or { net:get_interface() }) do - old_ifs[#old_ifs+1] = i:name() + local alias = net:is_alias() + + if alias then + old_ifs[1] = '@' .. alias + else + for _, i in ipairs(net:get_interfaces() or { net:get_interface() }) do + old_ifs[#old_ifs+1] = i:name() + end end for i in ut.imatch(val) do @@ -335,6 +342,7 @@ if not net:is_virtual() then ifname_multi = s:taboption("physical", Value, "ifname_multi", translate("Interface")) ifname_multi.template = "cbi/network_ifacelist" ifname_multi.nobridges = true + ifname_multi.noaliases = true ifname_multi.rmempty = false ifname_multi.network = arg[1] ifname_multi.widget = "checkbox" |