summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-12-06 15:11:57 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-12-06 15:11:57 -0800
commitb08b459b63ed55ea7cef186e433ad4bd9e205bd3 (patch)
tree3bed50e92fda5759e078e29596d87d5e02fbcf77 /scripts
parent5c7dd5e7f3423d76d675b9421d79ae671af041c1 (diff)
downloadvyatta-cfg-quagga-b08b459b63ed55ea7cef186e433ad4bd9e205bd3.tar.gz
vyatta-cfg-quagga-b08b459b63ed55ea7cef186e433ad4bd9e205bd3.zip
Fix check for local IP address
Bug 6517 Fix buggy comparison with regular expression by using new is_local_address from lib/Vyatta/Misc.pm
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl
index 67788174..383f085a 100755
--- a/scripts/bgp/vyatta-bgp.pl
+++ b/scripts/bgp/vyatta-bgp.pl
@@ -1073,13 +1073,9 @@ exit 0;
# Make sure the peer IP isn't a local system IP
sub check_neighbor_ip {
my $neighbor = shift;
- my $local_ips;
- $local_ips = join( ' ', getIP() );
-
- if ($local_ips =~ /$neighbor/g) {
- die "Can't set neighbor address to local system IP.\n";
- }
+ die "Can't set neighbor address to local system IP.\n"
+ if (is_local_address($neighbor));
exit 0;
}