summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Bays <robert@vyatta.com>2010-11-18 17:50:45 -0800
committerRobert Bays <robert@vyatta.com>2010-11-18 17:50:45 -0800
commitc16eed83ace66660a643273b052ebaa537afd373 (patch)
treec36c722a981ab392dc871663611eb1f1cdd199b4 /scripts
parent64ae8ae1477474ca94c432a6664a73cba220fd36 (diff)
downloadvyatta-cfg-quagga-c16eed83ace66660a643273b052ebaa537afd373.tar.gz
vyatta-cfg-quagga-c16eed83ace66660a643273b052ebaa537afd373.zip
fix bug 6430
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl
index 22e8aa9e..2b623bc0 100755
--- a/scripts/bgp/vyatta-bgp.pl
+++ b/scripts/bgp/vyatta-bgp.pl
@@ -1070,11 +1070,18 @@ was_iBGP_peer($neighbor, $as) if ($wasiBGPpeer);
exit 0;
-# Make sure the peer IP is properly formatted
+# Make sure the peer IP isn't a local system IP
sub check_neighbor_ip {
my $neighbor = shift;
+ my $local_ips;
- exit 1 if ! is_ip_v4_or_v6($neighbor);
+ $local_ips = `ip addr | grep inet`;
+ $local_ips =~ s/\s+inet(6*)\s(\S+)\/.+/$2 /g;
+
+ if ($local_ips =~ /$neighbor/g) {
+ die "Can't set neighbor address to local system IP.\n";
+ }
+
exit 0;
}
@@ -1096,7 +1103,7 @@ sub check_peergroup_name {
}
# Make sure we aren't deleteing a peer-group that has
-# neighbors configured to us it
+# neighbors configured to it
sub check_for_peer_groups {
my $config = new Vyatta::Config;
my $pg = shift;