summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Interface.pm
diff options
context:
space:
mode:
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