diff options
author | Daniel Dickinson <openwrt@daniel.thecshore.com> | 2015-12-14 22:51:29 -0500 |
---|---|---|
committer | Daniel Dickinson <openwrt@daniel.thecshore.com> | 2015-12-15 20:41:01 -0500 |
commit | c481f3f34325b9c1cf817b16a567a6b10fdd1f2e (patch) | |
tree | 5fe6f363c0ff7544a25bdbb21c17873ade06d272 /protocols | |
parent | bbcfad7953489ed87336e3a1981c9cb19e390cdb (diff) |
validation: Add option ipv4only option to host and hostport datatypes
Some applications only support ipv4 so add ipv4only option
to host and hostport datatypes so that for thos applications
that when an IP address is specified only and ipv4 ip address
gets accepted.
Diffstat (limited to 'protocols')
5 files changed, 5 insertions, 5 deletions
diff --git a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua index 9315dc25b..7b5e6043c 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua @@ -39,7 +39,7 @@ protocol.optional = true server = section:taboption("general", Value, "server", translate("Tunnel setup server"), translate("Optional, specify to override default server (tic.sixxs.net)")) -server.datatype = "host" +server.datatype = "host(0)" server.optional = true diff --git a/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua b/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua index 4ed34ae3b..ad3f2edf0 100644 --- a/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua +++ b/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua @@ -13,7 +13,7 @@ oc_key_file = "/etc/openconnect/user-key-" .. ifc .. ".pem" oc_ca_file = "/etc/openconnect/ca-" .. ifc .. ".pem" server = section:taboption("general", Value, "server", translate("VPN Server")) -server.datatype = "host" +server.datatype = "host(0)" port = section:taboption("general", Value, "port", translate("VPN Server port")) port.placeholder = "443" diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua index 5e8b3fcaa..506170c2d 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua @@ -8,7 +8,7 @@ local ipv6, defaultroute, metric, peerdns, dns, mtu server = section:taboption("general", Value, "server", translate("L2TP Server")) -server.datatype = "or(host, hostport)" +server.datatype = "or(host(1), hostport(1))" username = section:taboption("general", Value, "username", translate("PAP/CHAP username")) diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua index c93353af9..eca7bdd4d 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua @@ -8,7 +8,7 @@ local sshuser, server, port, ssh_options, identity, ipaddr, peeraddr sshuser = section:taboption("general", Value, "sshuser", translate("SSH username")) server = section:taboption("general", Value, "server", translate("SSH server address")) -server.datatype = "host" +server.datatype = "host(0)" port = section:taboption("general", Value, "port", translate("SSH server port")) port.datatype = "port" diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua index d81db1fae..462d7019f 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua @@ -9,7 +9,7 @@ local defaultroute, metric, peerdns, dns, server = section:taboption("general", Value, "server", translate("VPN Server")) -server.datatype = "host" +server.datatype = "host(0)" username = section:taboption("general", Value, "username", translate("PAP/CHAP username")) |