This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ 14307] Avoid duplicate DNS requests in case answeris longer than a (relatively small) implementation limit
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Jeroen van Bemmel <jvb127 at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 3 Jul 2012 10:49:29 +0530
- Subject: Re: [PATCH][BZ 14307] Avoid duplicate DNS requests in case answeris longer than a (relatively small) implementation limit
- References: <20120702223839.af3c10f491c1c4e6dfa2d964@gmail.com>
On Mon, 2 Jul 2012 22:38:39 -0600, Jeroen wrote:
> This patch increases the size of the temporary buffer by
> sizeof(struct host_data) - in two places - such that the first query
> response fits more easily. Because sizeof(struct host_data) varies
> per target platform, this patch reduces (but does not totally
> eliminate) the observed difference in network behavior for various
> platforms.
A long term fix would be to avoid the repeated queries in the first
place, but a cursory look at the code suggests that is going to be a
small project in itself, so it would be a good idea to get this fix in
for now.
> * This patch likely also fixes bug #13904
Yes it should.
> * I found the issue in a call to __gethostbyname2_r() in
> getaddrinfo() and tested the attached fix; I subsequently noticed
> that a similar buffer was used in a call to __gethostbyaddr_r() in
> the same function, so I applied a similar fix there - but without
> testing
You will need a fix for gethostbyname4_r as well on similar lines.
> 2012-07-02 Jeroen van Bemmel <jvb127@gmail.com>
^^
Two spaces between name and email address
A new line here, followed by the bugzilla numbers in square brackets
like this:
[BZ #14307][BZ #13904]
> * sysdeps/posix/getaddrinfo.c ( gaih_inet ): Increase the
> size of the temporary buffer used to invoke __gethostbyname2_r and
> __gethostbyaddr_r to make room for struct host_data.
> * resolv/nss_dns/dns-host.c (global scope): Move definition
> of implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS to header
> file nss/nsswitch.h.
> * nss/nsswitch.h (global scope): Add definition of
> implementation constants MAX_NR_ALIASES and MAX_NR_ADDRS (moved from
> resolv/nss_dns/dns-host.c).
All of this should be wrapped at 72 characters and correctly tabbed.
Please resubmit the patch and changelog entry with the changes above.
Also, I don't know if this counts as a trivial enough change to not
require a copyright assignment to FSF, so I'll let someone else who
knows better, comment on that.
Thanks,
Siddhesh