]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
linux: ignore setsockopt(IPV6_RECVERR)
authorLexi Winter <lexi@le-Fay.ORG>
Mon, 22 Apr 2024 21:58:11 +0000 (15:58 -0600)
committerWarner Losh <imp@FreeBSD.org>
Tue, 23 Apr 2024 04:36:34 +0000 (22:36 -0600)
commitca63710d3668cf6f3cb4faf065d8b4eeffa028ad
tree9a6d40ca0b87fee39dffc819e2d5c0350713eeb2
parent50ecbc5142e1c58f2132b351da19c5e4aa5f4e6a
linux: ignore setsockopt(IPV6_RECVERR)

Under Linux, the socket options IP_RECVERR and IPV6_RECVERR are used to
receive socket errors via a dedicated 'error queue' which can be
retrieved via recvmsg().  FreeBSD does not support this functionality.

For IPv4, the sysctl compat.linux.ignore_ip_recverr can be set to 1 to
silently ignore attempts to set IP_RECVERR and return success to the
application, which is wrong, but is required for (among other things)
a functional DNS client in recent versions of glibc.

Add support for ignoring IPV6_RECVERR, controlled by the same sysctl.
This fixes DNS in Linux when using IPv6 resolvers.

Reviewed by: imp, Jose Luis Duran
Pull Request: https://github.com/freebsd/freebsd-src/pull/1118
sys/compat/linux/linux_socket.c