From c481f3f34325b9c1cf817b16a567a6b10fdd1f2e Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Mon, 14 Dec 2015 22:51:29 -0500 Subject: 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. --- protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua | 2 +- .../luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppossh.lua | 2 +- protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pptp.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/luci-proto-ppp') 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 5e8b3fcaae..506170c2de 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 c93353af90..eca7bdd4d3 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 d81db1faee..462d7019f0 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")) -- cgit v1.2.3