Browse code

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 authored on 03/12/2013 22:38:41
Showing 1 changed files
... ...
@@ -2624,7 +2624,8 @@ struct hostent* dns_resolvehost(char* name)
2624 2624
 		ret =  _resolvehost(name);
2625 2625
 		if(unlikely(!ret)){
2626 2626
 			/* increment dns error counter */
2627
-			counter_inc(dns_cnts_h.failed_dns_req);
2627
+			if(counters_initialized())
2628
+				counter_inc(dns_cnts_h.failed_dns_req);
2628 2629
 		}
2629 2630
 		return ret;
2630 2631
 	}