Skip to content

Commit

Permalink
Use of ld_checkport in check_dns
Browse files Browse the repository at this point in the history
All other checks use the sub ld_checkport to get the real server port
for the service checks.
So we unify the code that the check_dns use the same sub to avoid
the an special solution.
  • Loading branch information
MorphBonehunter committed Nov 18, 2015
1 parent 0757887 commit 768e6d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ldirectord/ldirectord.in
Original file line number Diff line number Diff line change
Expand Up @@ -3637,6 +3637,7 @@ sub check_dns
my $request;
my $server;
my ($v,$r) = @_;
my $port = ld_checkport($v, $r);
{
# Net::DNS makes unguarded calls to eval
# which throw a fatal exception if they fail
Expand Down Expand Up @@ -3664,7 +3665,7 @@ sub check_dns
local $SIG{'ALRM'} = sub { die "timeout\n"; };
alarm($$v{negotiatetimeout});
$res->nameservers($server);
$res->port($$r{port}//$$v{port}//53);
$res->port($port);
if ($$v{"protocol"} eq "tcp") {
$res->usevc(1);
}
Expand Down

0 comments on commit 768e6d2

Please sign in to comment.