summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-02-15 12:09:08 +0000
committerAlex Harpin <development@landsofshadow.co.uk>2015-02-15 12:09:08 +0000
commit4258a200d20f4ddf6bac6fea02c311611a124f62 (patch)
tree3df07b476e7fc54c73e93c3d6b0831a936aca169 /lib
parent69c0bed62db7eac7f3dd05349a80dfff8756257c (diff)
downloadvyatta-cfg-4258a200d20f4ddf6bac6fea02c311611a124f62.tar.gz
vyatta-cfg-4258a200d20f4ddf6bac6fea02c311611a124f62.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
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Misc.pm10
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;
+ }
}
}