This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] resolv: Enable full ICMP errors for UDP DNS sockets [BZ #24047]
* Zack Weinberg:
> On Thu, Mar 7, 2019 at 7:08 AM Zack Weinberg <zackw@panix.com> wrote:
>>
>> On Thu, Mar 7, 2019 at 6:21 AM Florian Weimer <fweimer@redhat.com> wrote:
>> >
>> > * Florian Weimer:
>> >
>> > > The Linux kernel suppresses some ICMP error messages by default for
>> > > UDP sockets. This commit enables full ICMP error reporting,
>> > > hopefully resulting in faster failover to working name servers.
>> ...
>>
>> The documentation makes it sound like IP_RECVERR doesn't do anything
>> by itself, you need to call recvmsg(MSG_ERRQUEUE) to actually see the
>> errors. As far as I can tell, res_send.c doesn't do that, either
>> before or after this patch. Is the documentation wrong?
>
> er, by "the documentation" I am referring to the ip(7) manpage.
Yes, the documentation is misleading.
I believe the kernel code is in net/ipv4/raw.c in the raw_err function,
which handles ICMP errors for UDP as well. The harderr handling is
bypassed if the socket has IP_RECVERR set.
Thanks,
Florian