From: W.C.A. Wijngaards Date: Wed, 8 Sep 2021 13:07:11 +0000 (+0200) Subject: - Fix for #41: change outbound retry to int to fix signed comparison X-Git-Tag: release-1.14.0rc1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=829f3c932e325df537adf3df9deae664ab5e321d;p=thirdparty%2Funbound.git - Fix for #41: change outbound retry to int to fix signed comparison warnings. --- diff --git a/doc/Changelog b/doc/Changelog index 6592d3207..2bd68409d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,8 @@ processQueryResponse takes an iterator env argument like other functions in the iterator, no colon in string for set_option, and some whitespace style, to make it similar to the rest. + - Fix for #41: change outbound retry to int to fix signed comparison + warnings. 3 September 2021: Wouter - Fix #538: Fix subnetcache statistics. diff --git a/iterator/iter_utils.c b/iterator/iter_utils.c index ac7f5c1b2..2482a1f40 100644 --- a/iterator/iter_utils.c +++ b/iterator/iter_utils.c @@ -1285,7 +1285,7 @@ iter_scrub_nxdomain(struct dns_msg* msg) msg->rep->an_numrrsets = 0; } -void iter_dec_attempts(struct delegpt* dp, int d, size_t outbound_msg_retry) +void iter_dec_attempts(struct delegpt* dp, int d, int outbound_msg_retry) { struct delegpt_addr* a; for(a=dp->target_list; a; a = a->next_target) { @@ -1300,7 +1300,8 @@ void iter_dec_attempts(struct delegpt* dp, int d, size_t outbound_msg_retry) } } -void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old, size_t outbound_msg_retry) +void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old, + int outbound_msg_retry) { struct delegpt_addr* a, *o, *prev; for(a=dp->target_list; a; a = a->next_target) { diff --git a/iterator/iter_utils.h b/iterator/iter_utils.h index c6dc1e401..0a40916c0 100644 --- a/iterator/iter_utils.h +++ b/iterator/iter_utils.h @@ -349,7 +349,7 @@ void iter_scrub_nxdomain(struct dns_msg* msg); * @param d: decrease. * @param outbound_msg_retry: number of retries of outgoing queries */ -void iter_dec_attempts(struct delegpt* dp, int d, size_t outbound_msg_retry); +void iter_dec_attempts(struct delegpt* dp, int d, int outbound_msg_retry); /** * Add retry counts from older delegpt to newer delegpt. @@ -359,7 +359,7 @@ void iter_dec_attempts(struct delegpt* dp, int d, size_t outbound_msg_retry); * @param outbound_msg_retry: number of retries of outgoing queries */ void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old, - size_t outbound_msg_retry); + int outbound_msg_retry); /** * See if a DS response (type ANSWER) is too low: a nodata answer with diff --git a/iterator/iterator.h b/iterator/iterator.h index f99193231..a9e58569f 100644 --- a/iterator/iterator.h +++ b/iterator/iterator.h @@ -139,7 +139,7 @@ struct iter_env { size_t num_queries_ratelimited; /** number of retries on outgoing queries */ - size_t outbound_msg_retry; + int outbound_msg_retry; }; /** diff --git a/util/config_file.c b/util/config_file.c index a68099e58..39050f553 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -753,7 +753,7 @@ int config_set_option(struct config_file* cfg, const char* opt, else S_POW2("ratelimit-slabs:", ratelimit_slabs) else S_NUMBER_OR_ZERO("ip-ratelimit-factor:", ip_ratelimit_factor) else S_NUMBER_OR_ZERO("ratelimit-factor:", ratelimit_factor) - else S_SIZET_NONZERO("outbound-msg-retry:", outbound_msg_retry) + else S_NUMBER_NONZERO("outbound-msg-retry:", outbound_msg_retry) else S_SIZET_NONZERO("fast-server-num:", fast_server_num) else S_NUMBER_OR_ZERO("fast-server-permil:", fast_server_permil) else S_YNO("qname-minimisation:", qname_minimisation) diff --git a/util/config_file.h b/util/config_file.h index 618a88651..cd1bc7931 100644 --- a/util/config_file.h +++ b/util/config_file.h @@ -579,7 +579,7 @@ struct config_file { /** ratelimit factor, 0 blocks all, 10 allows 1/10 of traffic */ int ratelimit_factor; /** number of retries on outgoing queries */ - size_t outbound_msg_retry; + int outbound_msg_retry; /** minimise outgoing QNAME and hide original QTYPE if possible */ int qname_minimisation; /** minimise QNAME in strict mode, minimise according to RFC.