summaryrefslogtreecommitdiff
path: root/scripts/policy
diff options
context:
space:
mode:
authorRobert Bays <rbays@moresby.vyatta.com>2008-03-10 23:11:17 -0700
committerRobert Bays <rbays@moresby.vyatta.com>2008-03-10 23:11:17 -0700
commit456422fdc7c0cbe84ab837cba8f47270c0e75ad5 (patch)
treeadb31916939cfc8556421d58275da68dc2ccdb6d /scripts/policy
parent0797f7cd410ac7a3a5e2f9f28be90d5eb0e31366 (diff)
downloadvyatta-cfg-quagga-456422fdc7c0cbe84ab837cba8f47270c0e75ad5.tar.gz
vyatta-cfg-quagga-456422fdc7c0cbe84ab837cba8f47270c0e75ad5.zip
fix for bugs 2541, 2888, 2676
Diffstat (limited to 'scripts/policy')
-rwxr-xr-xscripts/policy/vyatta-policy.pl24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/policy/vyatta-policy.pl b/scripts/policy/vyatta-policy.pl
index 51aa163a..b47d9c96 100755
--- a/scripts/policy/vyatta-policy.pl
+++ b/scripts/policy/vyatta-policy.pl
@@ -9,12 +9,14 @@ 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,
);
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); }
exit 0;
@@ -209,3 +211,25 @@ 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>
+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") {
+ print "You can not change the action for $routemap.\n";
+ print "To change the action you must first delete the rule and commit it.\n\n";
+ exit 1;
+ }
+ }
+
+ exit 0;
+}