Fix some warnings

This commit is contained in:
Jamie Cameron
2016-08-07 22:11:30 -07:00
parent 162e181c21
commit c8f403c5f6
2 changed files with 5 additions and 4 deletions

View File

@@ -1579,10 +1579,11 @@ return $chroot.$_[0];
# Returns 2 if rndc is installed, 1 if ndc is instaled, or 0
sub has_ndc
{
if ($config{'rndc_cmd'} =~ /^(\S+)/ && &has_command("$1") && $_[0] != 2) {
my $mode = $_[0] || 0;
if ($config{'rndc_cmd'} =~ /^(\S+)/ && &has_command("$1") && $mode != 2) {
return 2;
}
if ($config{'ndc_cmd'} =~ /^(\S+)/ && &has_command("$1") && $_[0] != 1) {
if ($config{'ndc_cmd'} =~ /^(\S+)/ && &has_command("$1") && $mode != 1) {
return 1;
}
return 0;

View File

@@ -632,12 +632,12 @@ if ($addr =~ /^([\da-f]\.)+$ipv6revzone/i) {
return $_[0];
}
# net_to_ip6int(address, bits)
# net_to_ip6int(address, [bits])
# Converts an IPv6 address like 1234:dcba:: to a.b.c.d.4.3.2.1.ip6.int.
sub net_to_ip6int
{
my $addr = lc($_[0]);
my $n = $_[1] >> 2;
my $n = $_[1] ? $_[1] >> 2 : 0;
if (&check_ip6address($addr)) {
$addr = reverse(split(/\:/, &expandall_ip6($addr)));
$addr =~ s/(\w)/$1\./g;