This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Default number of dns retries doubled


On 16/08/13 20:34, Carlos O'Donell wrote:
You'll have to dig into the code to see why it's sending multiple requests.

If you can put together a reproducer (usually a test program,
/etc/resolv.conf, and a bind config) that we can run on a single
system that would be great.

Cheers,
Carlos.
Ok, it turns out to be really silly.
Checking the glibc functions, res_ninit() does indeed initialize retry to RES_DFLRETRY (2)
but res_init() does its own initialization hardcoding a 4 on that field:
_res.retry = 4;

It seems to have been this way since b43b13ac25, which introduced the RES_DFLRETRY set to 2 while keeping the line hardcoding it to 4 (although moved from res_init.c
to res_libc.c)

And that line goes back to the original 1995 commit 28f540f4.


So I guess RES_DFLRETRY should be changed to 4 (and the 4 to the constant), to keep the historical behavior. It will be a change for programs calling res_ninit() directly, but less intrusive than changing the res_init() default used on almost every networked program (although I wonder how many systems out there work with 4 attempts but would fail with 2, probably few, but there's the possibility on systems with an high
packet drop).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]