diff options
author | Robert Bays <robert@vyatta.com> | 2010-11-18 17:50:45 -0800 |
---|---|---|
committer | Robert Bays <robert@vyatta.com> | 2010-11-18 17:50:45 -0800 |
commit | c16eed83ace66660a643273b052ebaa537afd373 (patch) | |
tree | c36c722a981ab392dc871663611eb1f1cdd199b4 /scripts/bgp/vyatta-bgp.pl | |
parent | 64ae8ae1477474ca94c432a6664a73cba220fd36 (diff) | |
download | vyatta-cfg-quagga-c16eed83ace66660a643273b052ebaa537afd373.tar.gz vyatta-cfg-quagga-c16eed83ace66660a643273b052ebaa537afd373.zip |
fix bug 6430
Diffstat (limited to 'scripts/bgp/vyatta-bgp.pl')
-rwxr-xr-x | scripts/bgp/vyatta-bgp.pl | 13 |
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; |