diff options
author | rbalocca <rbalocca@vyatta.com> | 2008-03-14 14:44:16 -0700 |
---|---|---|
committer | rbalocca <rbalocca@vyatta.com> | 2008-03-14 14:44:16 -0700 |
commit | e3b1e82cc2f5183993e7136bbf452b041e7055a6 (patch) | |
tree | dc67261e17b88786fece199d9c6cd5b973637416 /scripts | |
parent | 0127c333b2634ba2833569e7ce546c898312bd99 (diff) | |
parent | 8d008f9f2cbbd80a54d30e94c1b7daa3d1c172f7 (diff) | |
download | vyatta-cfg-quagga-e3b1e82cc2f5183993e7136bbf452b041e7055a6.tar.gz vyatta-cfg-quagga-e3b1e82cc2f5183993e7136bbf452b041e7055a6.zip |
Merge branch 'glendale' into hollywood
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bgp/vyatta-bgp.pl | 7 | ||||
-rwxr-xr-x | scripts/policy/vyatta-policy.pl | 40 |
2 files changed, 47 insertions, 0 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index 059ce1a5..d0f9c94c 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -36,6 +36,13 @@ sub check_peer_name() { print "malformed neighbor address $neighbor\n"; exit 1; } + + # Quagga treats the first byte as a potential IPv6 address + # so we can't use it as a peer group name. So let's check for it. + if (/^[A-Fa-f]{1,4}$/) { + print "malformed neighbor address $neighbor\n"; + exit 1; + } } # Make sure we aren't deleteing a peer-group that has diff --git a/scripts/policy/vyatta-policy.pl b/scripts/policy/vyatta-policy.pl index 51aa163a..e840271e 100755 --- a/scripts/policy/vyatta-policy.pl +++ b/scripts/policy/vyatta-policy.pl @@ -9,12 +9,16 @@ GetOptions("update-access-list=s" => \$accesslist, "update-aspath-list=s" => \$aspathlist, "update-community-list=s" => \$communitylist, "check-peer-syntax=s" => \$peer, + "check-routemap-action=s" => \$routemap, + "check-delete-routemap-action=s" => \$deleteroutemap, ); if (defined $accesslist) { update_access_list($accesslist); } if (defined $aspathlist) { update_as_path($aspathlist); } if (defined $communitylist) { update_community_list($communitylist); } if (defined $peer) { check_peer_syntax($peer); } +if (defined $routemap) { check_routemap_action($routemap); } +if (defined $deleteroutemap) { check_delete_routemap_action($deleteroutemap); } exit 0; @@ -209,3 +213,39 @@ sub update_access_list() { exit 0; } +## check_routemap_action +# check if the action has been changed since the last commit. +# we need to do this because quagga will wipe the entire config if +# the action is changed. +# $1 = policy route-map <name> rule <num> action +sub check_routemap_action() { + my $routemap = shift; + my $config = new VyattaConfig; + + my $action = $config->setLevel("$routemap"); + my $origvalue = $config->returnOrigValue(); + if ($origvalue) { + my $value = $config->returnValue(); + if ("$value" ne "$origvalue") { + exit 1; + } + } + + exit 0; +} + +## check_delete_routemap_action +# don't allow deleteing the route-map action if other sibling nodes exist. +# action is required for all other route-map definitions +# $1 = policy route-map <name> rule <num> +sub check_delete_routemap_action() { + my $routemap = shift; + my $config = new VyattaConfig; + + my @nodes = $config->listNodes("$routemap"); + if (defined @nodes) { + exit 1 + } + + exit 0; +} |