Переглянути джерело

core: don't increment failed dns query counter for reverse dns lookup at startup

- it can happen before counters are intialized, thus check that before
- reported by Hugh Waite, FS#375

(cherry picked from commit 89c6d73dd51eb9b96f50d3f04219612fa7725224)
(cherry picked from commit a3169d02d7527110941fab8de25ba75aae759ce1)
Daniel-Constantin Mierla 11 роки тому
батько
коміт
fbf78b84ea
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      dns_cache.c

+ 2 - 1
dns_cache.c

@@ -2624,7 +2624,8 @@ struct hostent* dns_resolvehost(char* name)
 		ret =  _resolvehost(name);
 		if(unlikely(!ret)){
 			/* increment dns error counter */
-			counter_inc(dns_cnts_h.failed_dns_req);
+			if(counters_initialized())
+				counter_inc(dns_cnts_h.failed_dns_req);
 		}
 		return ret;
 	}