summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bays <robert@vyatta.com>2010-08-10 16:40:37 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-12 11:22:08 -0400
commit41eee229bb7d7e681bd514a916654ebaddf7af13 (patch)
tree1293e6904f026fc240787aab5b7110e4bfc89291
parent2f2d0e30858b5623d5c587e0a63aae55ed2bddd1 (diff)
downloadvyatta-cfg-quagga-41eee229bb7d7e681bd514a916654ebaddf7af13.tar.gz
vyatta-cfg-quagga-41eee229bb7d7e681bd514a916654ebaddf7af13.zip
fix for bug 6021
(cherry picked from commit bd7d722092948eaf9609b79b822a032604d2dd55)
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl19
1 files changed, 12 insertions, 7 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl
index 9cbde833..3bfb4cc0 100755
--- a/scripts/bgp/vyatta-bgp.pl
+++ b/scripts/bgp/vyatta-bgp.pl
@@ -1316,6 +1316,13 @@ sub check_remote_as {
$config->isChanged("$as neighbor $neighbor peer-group") ||
$config->isDeleted("$as neighbor $neighbor peer-group") );
+ if ($config->isDeleted("$as neighbor $neighbor remote-as")) {
+ my @neighbor_params = undef;
+ @neighbor_params = $config->listNodes("$as neighbor $neighbor");
+ die "[protocols bgp $as neighbor $neighbor]\n must delete the neighbor first if changing the remote-as\n"
+ if (@neighbor_params);
+ }
+
# First check that we have a remote-as defined in the neighbor or that
# the neighbor is a member of a peer-group that has a remote-as defined
my ($remoteas, $peergroup, $peergroupas);
@@ -1330,13 +1337,11 @@ sub check_remote_as {
die "[protocols bgp $as neighbor $neighbor]\n must define a remote-as or peer-group\n"
unless ($peergroup || $remoteas);
- if ($peergroup) {
- die "[protocols bgp $as neighbor $neighbor]\n remote-as should not be defined in both neighbor and peer-group\n"
- if ($remoteas && $peergroupas);
-
- die "[protocols bgp $as neighbor $neighbor]\n must define a remote-as in neighbor or peer-group $peergroup\n"
- unless ($peergroupas);
- }
+ die "[protocols bgp $as neighbor $neighbor]\n remote-as should not be defined in both neighbor and peer-group\n"
+ if ($remoteas && $peergroupas);
+
+ die "[protocols bgp $as neighbor $neighbor]\n must define a remote-as in neighbor or peer-group $peergroup\n"
+ if ( (! $remoteas) && (! $peergroupas) );
# now check if changing remote-as type from/to i/eBGP
my $error = bgp_type_change($neighbor, $as, "neighbor");