From 7d181bfaafd262f95bcf13e1c358a043ee6c685c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 28 Apr 2009 22:47:27 -0700 Subject: Fix bug in is_ip_configured Bug 4311 Doing grep ($ip, @list) will return whole list since it evaluted $ip as a expression and the result was defined. --- scripts/vyatta-interfaces.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 25fefc9..c4e5c4e 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -90,8 +90,8 @@ exit 0; sub is_ip_configured { my ($intf, $ip) = @_; - my @found = grep $ip, Vyatta::Misc::getIP($intf); - return ($#found > 0); + my $found = grep { $_ eq $ip } Vyatta::Misc::getIP($intf); + return ($found > 0); } sub is_ip_duplicate { -- cgit v1.2.3