Skip to content

Commit

Permalink
network: ARES_OPT_TRIES must be set to update opt.tries (#8587)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* 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 <[email protected]>

---------

Signed-off-by: bazzargh <[email protected]>
  • Loading branch information
bazzargh authored Nov 9, 2024
1 parent 22e7667 commit a162864
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/flb_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a162864

Please sign in to comment.