diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index faa932abf..f06c28c33 100755 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -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; diff --git a/bind8/records-lib.pl b/bind8/records-lib.pl index 9efb0ac90..3d6f61c6d 100755 --- a/bind8/records-lib.pl +++ b/bind8/records-lib.pl @@ -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;