From 4258a200d20f4ddf6bac6fea02c311611a124f62 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sun, 15 Feb 2015 12:09:08 +0000 Subject: vyatta-cfg: update get_ipaddr_int_hash for vtun and wan interfaces Expand the matching done in get_ipaddr_int_hash to account for the fact that the output from "ip addr show" is different for vtun and wan interfaces; add a separate check for these interfaces. Bug #35 http://bugzilla.vyos.net/show_bug.cgi?id=35 --- lib/Vyatta/Misc.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm index 2a5c880..1f5a915 100755 --- a/lib/Vyatta/Misc.pm +++ b/lib/Vyatta/Misc.pm @@ -52,8 +52,14 @@ sub get_ipaddr_intf_hash { my @lines = `ip addr show | grep 'inet '`; chomp @lines; foreach my $line (@lines) { - if ($line =~ /inet\s+([0-9.]+)\/.*\s([\w.]+)$/) { - $config_ipaddrs{$1} = $2; + if ($line =~ /vtun|wan/) { + if ($line =~ /inet\s+([0-9.]+).*\s([\w.]+)$/) { + $config_ipaddrs{$1} = $2; + } + } else { + if ($line =~ /inet\s+([0-9.]+)\/.*\s([\w.]+)$/) { + $config_ipaddrs{$1} = $2; + } } } -- cgit v1.2.3