summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-06-26 17:11:52 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2015-06-26 17:11:52 +0100
commitdc093ef387d2514c3b81b0766dda8bdc78890129 (patch)
treed0d70114a587f4af269d7947ad2330f521ecb710 /scripts
parent6237d4de2e8c64c1de42c42a070ef74907810dd7 (diff)
downloadvyatta-cfg-vpn-dc093ef387d2514c3b81b0766dda8bdc78890129.tar.gz
vyatta-cfg-vpn-dc093ef387d2514c3b81b0766dda8bdc78890129.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 5373ddf..fbfad64 100755
--- a/scripts/vyatta-vti-config.pl
+++ b/scripts/vyatta-vti-config.pl
@@ -134,8 +134,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;
}