summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Interface.pm
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-20 10:11:21 +1100
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-20 10:11:21 +1100
commit05f12fecffab242122c2702c049b48500ae8081a (patch)
treed10b223c178ba9e32cbaea7e671f4b60f6837a76 /lib/Vyatta/Interface.pm
parentc28287fcf5ba523a46f86ec84c6dd648d2fcbe73 (diff)
downloadvyatta-cfg-05f12fecffab242122c2702c049b48500ae8081a.tar.gz
vyatta-cfg-05f12fecffab242122c2702c049b48500ae8081a.zip
Fix isIPinInterfaces
fix bug in conversion to Vyatta::Interface by rewriting/refactoring.
Diffstat (limited to 'lib/Vyatta/Interface.pm')
-rw-r--r--lib/Vyatta/Interface.pm19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/Vyatta/Interface.pm b/lib/Vyatta/Interface.pm
index 687ef67..ea9c40f 100644
--- a/lib/Vyatta/Interface.pm
+++ b/lib/Vyatta/Interface.pm
@@ -177,24 +177,7 @@ sub using_dhcp {
sub address {
my ($self, $type) = @_;
- open my $ipcmd, "ip addr show dev $self->{name} |"
- or die "ip addr command failed: $!";
-
- my @addresses;
- <$ipcmd>;
- while (<$ipcmd>) {
- my ($proto, $addr) = split;
- next unless ($proto =~ /inet/);
- if ($type) {
- next if ($proto eq 'inet6' && $type != 6);
- next if ($proto eq 'inet' && $type != 4);
- }
-
- push @addresses, $addr;
- }
- close $ipcmd;
-
- return @addresses;
+ return Vyatta::Misc::getIP($self->{name}, $type);
}
# return