Module: sip-router Branch: 4.0 Commit: fbf78b84eaf9b7c8e2924db996807cd6851a3a00 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fbf78b84...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Tue Dec 3 23:38:41 2013 +0100
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)
---
dns_cache.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dns_cache.c b/dns_cache.c index 5690cb6..4e97ac1 100644 --- a/dns_cache.c +++ b/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; }