Merge pull request #565 from yousong/l2tp-server
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 2 Dec 2015 12:57:05 +0000 (13:57 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 2 Dec 2015 12:57:05 +0000 (13:57 +0100)
Allow host:port value for l2tp `server` option

modules/luci-base/luasrc/view/cbi/value.htm
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua

index 8a08e08..c43dab5 100644 (file)
@@ -29,7 +29,7 @@
                <%- end -%>');
                <%- end %>
                <% if self.datatype then -%>
-               cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype:gsub("'", "\\'")%>');
+               cbi_validate_field('<%=cbid%>', <%=tostring((self.optional or self.rmempty) == true)%>, '<%=self.datatype:gsub("\\", "\\\\"):gsub("'", "\\'")%>');
                <%- end %>
        //]]></script>
        <% end -%>
index 523ef1b..5e8b3fc 100644 (file)
@@ -8,7 +8,7 @@ local ipv6, defaultroute, metric, peerdns, dns, mtu
 
 
 server = section:taboption("general", Value, "server", translate("L2TP Server"))
-server.datatype = "host"
+server.datatype = "or(host, hostport)"
 
 
 username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))