diff options
Diffstat (limited to 'lib/Vyatta/Misc.pm')
-rwxr-xr-x | lib/Vyatta/Misc.pm | 10 |
1 files changed, 8 insertions, 2 deletions
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; + } } } |