From b08b459b63ed55ea7cef186e433ad4bd9e205bd3 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 6 Dec 2010 15:11:57 -0800 Subject: 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 --- debian/control | 2 +- scripts/bgp/vyatta-bgp.pl | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/debian/control b/debian/control index 6f7caa3b..35bdf71d 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Depends: sed (>= 4.1.5), perl (>= 5.8.8), procps (>= 1:3.2.7-3), coreutils (>= 5.97-5.3), - vyatta-cfg (>= 0.15.33), + vyatta-cfg (>= 0.18.56), libc6 (>= 2.7-6), vyatta-bash | bash (>= 3.1), vyatta-quagga (>= 0.99.15-26) 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; } -- cgit v1.2.3