summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-28 22:47:27 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-28 22:47:27 -0700
commit7d181bfaafd262f95bcf13e1c358a043ee6c685c (patch)
tree5bbec545e8715d2814fa59bde5cfc82404dce70f /scripts
parent91be36bece8c9ebc1ed89e36a7b2f52fe9a9fb67 (diff)
downloadvyatta-cfg-7d181bfaafd262f95bcf13e1c358a043ee6c685c.tar.gz
vyatta-cfg-7d181bfaafd262f95bcf13e1c358a043ee6c685c.zip
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-interfaces.pl4
1 files 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 {