From a16286492e49c85fddec30aee4062d9b6dd6da86 Mon Sep 17 00:00:00 2001 From: bazzargh Date: Sat, 9 Nov 2024 05:57:50 +0000 Subject: [PATCH] network: ARES_OPT_TRIES must be set to update opt.tries (#8587) * fix: ARES_OPT_TRIES must be set to update opt.tries This is a typo I spotted in reviewing #5613 - the current code appears to set opt.tries to 2 (from the default 3) but because the corresponding optflag is not set it will be ignored. See the c-ares code that is being called: https://github.com/c-ares/c-ares/blob/e4a4346596c62621704371270220b567b0ddd83d/src/lib/ares_options.c#L310-L316 Signed-off-by: bazzargh * fix: remove retries following comments in the PR, the preferred option is to remove the ineffective retries option and the mask that would have caused it to have any effect. The resulting code should behave exactly as before, since the mask was required for the original retries option to work, and it has never been set; so no additonal tests are supplied. Signed-off-by: bazzargh --------- Signed-off-by: bazzargh --- src/flb_network.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/flb_network.c b/src/flb_network.c index 7ac86e98f67..f9c5bb976a7 100644 --- a/src/flb_network.c +++ b/src/flb_network.c @@ -1045,12 +1045,9 @@ static struct flb_dns_lookup_context *flb_net_dns_lookup_context_create( return NULL; } - /* c-ares options: Set the transport layer to the desired protocol and - * the number of retries to 2 - */ + /* c-ares options: Set the transport layer to the desired protocol */ optmask = ARES_OPT_FLAGS; - opts.tries = 2; if (dns_mode == FLB_DNS_USE_TCP) { opts.flags = ARES_FLAG_USEVC;