summaryrefslogtreecommitdiff
path: root/scripts/policy/vyatta-check-as-prepend.pl
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@uffda.(none)>2007-11-19 18:44:27 -0800
committerStig Thormodsrud <stig@uffda.(none)>2007-11-19 18:44:27 -0800
commit8306b478bee23055c5b0c47991ca5f35225e885d (patch)
treeaaa721162759c932f5a0ae59b7b86bfece94af53 /scripts/policy/vyatta-check-as-prepend.pl
parent5318fb1b6189e564dd533ffc4857c8743b19deee (diff)
downloadvyatta-cfg-quagga-8306b478bee23055c5b0c47991ca5f35225e885d.tar.gz
vyatta-cfg-quagga-8306b478bee23055c5b0c47991ca5f35225e885d.zip
Add syntax validation for as-path prepend.
Diffstat (limited to 'scripts/policy/vyatta-check-as-prepend.pl')
-rwxr-xr-xscripts/policy/vyatta-check-as-prepend.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/policy/vyatta-check-as-prepend.pl b/scripts/policy/vyatta-check-as-prepend.pl
new file mode 100755
index 00000000..0da3d8d6
--- /dev/null
+++ b/scripts/policy/vyatta-check-as-prepend.pl
@@ -0,0 +1,6 @@
+#!/usr/bin/perl
+@as_list = split(' ',$ARGV[0]);
+foreach $as (@as_list) {
+ if ($as =~ /[^\d\s]/ || $as < 1 || $as > 65535) { exit 1;}
+}
+exit 0;