summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-06-26 17:11:52 +0100
committerJeff Leung <jleung@v10networks.ca>2015-12-05 04:28:14 -0500
commit33140773880aa3f4a94426c35c667096259d9c3d (patch)
tree5fe2244fd79348489e38759e317aaf652f20ed8b /scripts
parent9254caf8bd4d8dfc0e76f1eb5958e6ebcdf1032d (diff)
downloadvyatta-cfg-vpn-33140773880aa3f4a94426c35c667096259d9c3d.tar.gz
vyatta-cfg-vpn-33140773880aa3f4a94426c35c667096259d9c3d.zip
vyatta-cfg-vpn: validate local address for vti based vpn connections
Validate the local address used for VTI based VPN connections to ensure only either an IPv4 or IPv6 address is used. Currently VTIs can only accept these for local addresses, other values will fail with extraneous error messages, trap these earlier in the configuation commit process for now. Bug #213 http://bugzilla.vyos.net/show_bug.cgi?id=213
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-vti-config.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/vyatta-vti-config.pl b/scripts/vyatta-vti-config.pl
index 23bead1..042ef3b 100755
--- a/scripts/vyatta-vti-config.pl
+++ b/scripts/vyatta-vti-config.pl
@@ -128,8 +128,8 @@ foreach my $peer (@peers) {
exit -1;
}
- if ($lip eq "" || $lip eq "0.0.0.0") {
- print STDERR "$vti_cfg_err Invalid local-address \"$lip\".\n";
+ if (!(validateType('ipv4', $lip, 'quiet') || validateType('ipv6', $lip, 'quiet')) || ($lip eq '0.0.0.0')) {
+ print STDERR "$vti_cfg_err Invalid local-address \"$lip\", an ip address must be specified for VTIs.\n";
exit -1;
}