diff options
author | Alex Harpin <development@landsofshadow.co.uk> | 2015-02-15 12:09:08 +0000 |
---|---|---|
committer | Alex Harpin <development@landsofshadow.co.uk> | 2015-02-24 21:44:06 +0000 |
commit | 8a312f1ea82f08bf4ab67b925ea6d6178568f8fb (patch) | |
tree | cfb3291745f30252ac506d70069acc09ebb8ed25 | |
parent | f27c71e41845b44b357cd2516bf8d3ee2134dd0e (diff) | |
download | vyatta-cfg-8a312f1ea82f08bf4ab67b925ea6d6178568f8fb.tar.gz vyatta-cfg-8a312f1ea82f08bf4ab67b925ea6d6178568f8fb.zip |
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
-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; + } } } |