mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
dns.cgi: Only perform reverse lookup if DNS is working.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -411,6 +411,7 @@ sub show_nameservers () {
|
||||
|
||||
my $dns_status_string;
|
||||
my $dns_status_col;
|
||||
my $dns_working;
|
||||
|
||||
# Test if the DNS system is working.
|
||||
#
|
||||
@@ -421,6 +422,7 @@ sub show_nameservers () {
|
||||
if ($dns_status_ret eq "2") {
|
||||
$dns_status_string = "$Lang::tr{'working'}";
|
||||
$dns_status_col = "${Header::colourgreen}";
|
||||
$dns_working = 1;
|
||||
} else {
|
||||
$dns_status_string = "$Lang::tr{'broken'}";
|
||||
$dns_status_col = "${Header::colourred}";
|
||||
@@ -577,7 +579,7 @@ END
|
||||
my $rdns;
|
||||
|
||||
# Only do the reverse lookup if the system is online.
|
||||
if (&red_is_active()) {
|
||||
if ($dns_working) {
|
||||
my $iaddr = inet_aton($nameserver);
|
||||
$rdns = gethostbyaddr($iaddr, AF_INET);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user