diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 9369e8514..3e81c8e59 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -240,6 +240,7 @@ function wizard_add() local netmask = luci.http.formvalue("cbid.network.%s.netmask" % intf) or "" local gateway = luci.http.formvalue("cbid.network.%s.gateway" % intf) or "" local ip6gw = luci.http.formvalue("cbid.network.%s.ip6gw" % intf) or "" + local ipv6 = luci.http.formvalue("cbid.network.%s.ipv6" % intf) or "0" local apn = luci.http.formvalue("cbid.network.%s.apn" % intf) or "" local pincode = luci.http.formvalue("cbid.network.%s.pincode" % intf) or "" local delay = luci.http.formvalue("cbid.network.%s.delay" % intf) or "" @@ -282,6 +283,7 @@ function wizard_add() ucic:set("network",intf,"auth",auth) ucic:set("network",intf,"mode",mode) ucic:set("network",intf,"label",label) + ucic:set("network",intf,"ipv6",ipv6) if lan == "1" then ucic:set("network",intf,"multipath","off") else @@ -1077,7 +1079,13 @@ end function get_device(interface) local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {}) if dump ~= nil then - return dump['l3_device'] + if dump['l3_device'] ~= nil then + return dump['l3_device'] + elseif dump['device'] ~= nil then + return dump['device'] + else + return "" + end else return "" end diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 0e7e838a6..363b30852 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -561,12 +561,14 @@ <% iffind=0 uciifname=uci:get("network",ifname,"ifname") - if uciifname:match("/") then - realifname=uciifname - vlan="" - else - realifname=splitstring(uciifname,'.')[1] or "" - vlan=splitstring(uciifname,'.')[2] or "" + if uciifname ~= nil then + if uciifname:match("/") then + realifname=uciifname + vlan="" + else + realifname=splitstring(uciifname,'.')[1] or "" + vlan=splitstring(uciifname,'.')[2] or "" + end end for _, ifacea in ipairs(ifaces) do if not (ifacea == "lo" or ifacea == "6in4-omr6in4" or ifacea == "mlvpn0" or ifacea:match("^ifb.*") or ifacea:match("^sit.*") or ifacea:match("^gre.*") or ifacea:match("^ip6.*") or ifacea:match("^teql.*") or ifacea:match("^erspan.*") or ifacea:match("^tun.*")) and device_notvirtual(ifacea) then @@ -671,6 +673,13 @@ <% end %> +