summaryrefslogtreecommitdiff
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
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
-rw-r--r--debian/control2
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl8
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;
}