diff options
author | matteo <matteo.pasotti@gmail.com> | 2015-02-07 17:13:56 +0200 |
---|---|---|
committer | matteo <matteo.pasotti@gmail.com> | 2015-02-07 17:13:56 +0200 |
commit | 839b3f8ac96da663d8a5b9aaeb4db5d40a458f75 (patch) | |
tree | d064c4601a6e67f4fc35cf4e82dd3b3cbad6e080 | |
parent | 04ab86e5dcb9e2fa134c8bd99d37dd2f8d63034e (diff) | |
download | manatools-839b3f8ac96da663d8a5b9aaeb4db5d40a458f75.tar manatools-839b3f8ac96da663d8a5b9aaeb4db5d40a458f75.tar.gz manatools-839b3f8ac96da663d8a5b9aaeb4db5d40a458f75.tar.bz2 manatools-839b3f8ac96da663d8a5b9aaeb4db5d40a458f75.tar.xz manatools-839b3f8ac96da663d8a5b9aaeb4db5d40a458f75.zip |
fixed warning on comparison with uninitialized vars (sub get_net_zone_interfaces)
-rw-r--r-- | lib/AdminPanel/Shared/Shorewall.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AdminPanel/Shared/Shorewall.pm b/lib/AdminPanel/Shared/Shorewall.pm index 77c6776f..eb08fa88 100644 --- a/lib/AdminPanel/Shared/Shorewall.pm +++ b/lib/AdminPanel/Shared/Shorewall.pm @@ -69,8 +69,15 @@ sub dev_to_shorewall { sub get_net_zone_interfaces { my ($interfacesfile, $_net, $all_intf) = @_; - #- read shorewall configuration first - my @interfaces = map { $_->[1] } grep { $_->[0] eq 'net' } $interfacesfile; + if(ref($interfacesfile) eq "ARRAY") + { + #- read shorewall configuration first + my @interfaces = map { $_->[1] } grep { $_->[0] eq 'net' } $interfacesfile; + } + else + { + my @interfaces = undef; + } #- else try to find the best interface available @interfaces ? @interfaces : @{$all_intf || []}; } |