[PATCH COMMITTED] nss_dns: Remove dead PTR IPv4-to-IPv6 mapping code
Andreas Schwab
schwab@suse.de
Wed Sep 6 13:51:00 GMT 2017
On Sep 06 2017, Florian Weimer <fweimer@redhat.com> wrote:
> 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.
But it's inside a loop, and have_to_map is not reset.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list