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)

Daniel-Constantin Mierla authored on 03/12/2013 22:38:41
Showing 1 changed files
... ...
@@ -2599,7 +2599,8 @@ struct hostent* dns_resolvehost(char* name)
2599 2599
 		ret =  _resolvehost(name);
2600 2600
 		if(unlikely(!ret)){
2601 2601
 			/* increment dns error counter */
2602
-			counter_inc(dns_cnts_h.failed_dns_req);
2602
+			if(counters_initialized())
2603
+				counter_inc(dns_cnts_h.failed_dns_req);
2603 2604
 		}
2604 2605
 		return ret;
2605 2606
 	}