This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH COMMITTED] nss_dns: Remove dead PTR IPv4-to-IPv6 mapping code
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 6 Sep 2017 15:43:55 +0200
- Subject: Re: [PATCH COMMITTED] nss_dns: Remove dead PTR IPv4-to-IPv6 mapping code
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 107995D687
- References: <20170906131329.924C94194EE17@oldenburg.str.redhat.com> <mvmmv68c5qa.fsf@suse.de>
On 09/06/2017 03:32 PM, Andreas Schwab wrote:
> On Sep 06 2017, fweimer@redhat.com (Florian Weimer) wrote:
>
>> Remove dead PTR IPv4-to-IPv6 mapping code from nss_dns.
>> * resolv/nss_dns/dns-host.c (getanswer_r): Remove dead code.
>
> In which way is that dead?
if (type == T_A && qtype == T_AAAA && map)
have_to_map = 1;
else if (__glibc_unlikely (type != qtype))
{
cp += n;
continue; /* XXX - had_error++ ? */
}
So have_to_map being true implies that qtype == T_AAAA. But this means
that after the if statement, type == T_A || type == T_AAAA. In
particular, type != T_PTR, which is why the have_to_map check is
superfluous.
The added tests also show it's dead code.
Thanks,
Florian