summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bays <robert@vyatta.com>2010-07-14 22:15:37 -0700
committerRobert Bays <robert@vyatta.com>2010-07-14 22:15:37 -0700
commitf45107c41e01b2475304e243e25e0f25542395b6 (patch)
treea2b5556efcde58a39b8c38ac13524e42c2352c48
parent3f165e541a87a1983e7adac72d1a58ba2df300fe (diff)
downloadvyatta-cfg-quagga-f45107c41e01b2475304e243e25e0f25542395b6.tar.gz
vyatta-cfg-quagga-f45107c41e01b2475304e243e25e0f25542395b6.zip
move conditional checks for ttl-security back into the node.def files to keep them from being checked on every commit
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl13
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def1
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/ttl-security/hops/node.def1
3 files changed, 2 insertions, 13 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl
index daf5b360..c6188d36 100755
--- a/scripts/bgp/vyatta-bgp.pl
+++ b/scripts/bgp/vyatta-bgp.pl
@@ -1216,17 +1216,6 @@ sub check_for_peer_groups {
}
}
-
-# check that both ttl-security and ebgpmultihops aren't both defined
-sub check_ttl_conflict {
- my ($config, $path) = @_;
-
- my $ebgphops = $config->returnValue("$path ebgp-multihop");
- my $ttlsecurity = $config->returnValue("$path ttl-security hops");
- die "protocols bgp $path: can not define both ebgp-mulithop and ttl-security hops\n"
- if (defined($ebgphops) && defined($ttlsecurity));
-}
-
# check that changed neighbors have a remote-as or peer-group defined
sub check_remote_as {
my $config = new Vyatta::Config;
@@ -1239,8 +1228,6 @@ sub check_remote_as {
foreach my $neighbor (@neighbors) {
next unless $config->isChanged("$as neighbor $neighbor");
- check_ttl_conflict($config, "$as neighbor $neighbor");
-
my $remoteas = $config->returnValue("$as neighbor $neighbor remote-as");
my ($peergroup, $peergroupas);
if ($config->exists("$as neighbor $neighbor peer-group")) {
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def
index 8a89fc4c..14878cb4 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/ebgp-multihop/node.def
@@ -3,3 +3,4 @@ help: Allow this EBGP neighbor to not be on a directly connected network
comp_help: possible completions:
<1-255> number of hops
syntax:expression: $VAR(@) >=1 && $VAR(@) <= 255; "ebgp-multihop must be between 1 and 255"
+commit:expression: $VAR(../ttl-security/hops/) == ""; "protocols bgp $VAR(../../@) neighbor $VAR(../@) ebgp-multihop: you can't set both ebgp-multihop and ttl-security hops"
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/ttl-security/hops/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/ttl-security/hops/node.def
index c5950865..cd69bde9 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/ttl-security/hops/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/ttl-security/hops/node.def
@@ -3,3 +3,4 @@ help: Set number of the maximum number of hops to the BGP peer
comp_help: possible completions:
<1-254> number of hops
syntax:expression: $VAR(@) >=1 && $VAR(@) <= 254; "ttl-security hops must be between 1 and 254"
+commit:expression: $VAR(../../ebgp-multihop/) == ""; "protocols bgp $VAR(../../../@) neighbor $VAR(../../@) ttl-security hops: you can't set both ebgp-multihop and ttl-security hops"