From nobody Sat Apr 27 13:03:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VRVBs2TGbz5J4sJ; Sat, 27 Apr 2024 13:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VRVBs1fKRz4jrp; Sat, 27 Apr 2024 13:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714222997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jkcmEIVfz6ogm0Vgm+9P1uystdx+UF0D0DibSmgVkec=; b=ZNE1ywuCoC4Ak5yyKAOqE7NBcBjvVYf5yRBfxNYN0oveZVMhVa19r4sXM9P5fkdyuGZ3Lk +25zrZQQ3OHVaBGukcfiIxoU4DM9/E72nUomwXHUffanJDtEwyUPqX8yA1gA5nuaR4QA31 Cw3XkqUa30mNAqXU8zuTxNDSeiE7fQKmhQ/l5Ci3ttvKKF2Qosk6SSEX2jGYJ9dRFcI/2D WWO9CxcOfCZBxkSISZyj/YhXB0RpfvhZcxoQAjtlAFcPA8tJ80rCvFUVArkgmsDQszBSZr jbssjGZxkL0W+VwtT6a1p2EOOtE1hZ0cogWhMjshkLmrJe/SyctnO2n+KDINEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714222997; a=rsa-sha256; cv=none; b=Od54nr9VRHC+mx87by8Zw3/iuQBv8IS5DrPl13lu7FQfdLMljZ5IodhN4A7UXSrm+OIh+D cOe8zEMzof2YLmdMBuy8TP0fKTE4cgfjC5KFst4mp77NRxk0oFFYvdcyEBNjzXMkeV8xsF nn/h0cYGxuF/CWUjp3jdOkXv0hvKFbJVqqp3tM4W+ruddIBrbKJdGnQVWJ1tALx7p4LcwQ c8uMr0SPtZan30cbiimpas2QSfcT8OHuqXeVysnNBcjh4hBTAT48v6WR68WrYJzIhY3+89 uBplwb2w1NL0NTeEODSZtCPS1edan/8wae2OvW9ZlBOX1IiMS0mZVZTYec+f9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714222997; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jkcmEIVfz6ogm0Vgm+9P1uystdx+UF0D0DibSmgVkec=; b=IAuHsQjYA9/5uNzufNUUAM/BWn9zZRuex/zrZA5D+qFwRAdflIXmAsiVMPBbrXUQYVdr5i X1wUAIe2auaC23nwCZsk7FOz/YrFbiax1COHTYkz/qGPwc+f4+L+MNvGh6OCpSW7NOj20u 50ZFzp8lGgR0qv07ZHBUx9rsCdBESDFlDLZr5e0brqC1IPr2s82CXv8oM+5tlD0SaMRcVS Z/m4VnKL+rmLLHHqL4YXMtEZ+haaS/2pXgEWmAEfIbNtC/7Q7sVPgmqQ7We2NKHjnMovb4 M6FanxwlIPaEmNK4LhnoXi/K+tXn1f9T+DFr6UGNmeNtQzCg2uxERNkUNBNEBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VRVBs1C8NzRpl; Sat, 27 Apr 2024 13:03:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43RD3HoZ045461; Sat, 27 Apr 2024 13:03:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43RD3HIC045458; Sat, 27 Apr 2024 13:03:17 GMT (envelope-from git) Date: Sat, 27 Apr 2024 13:03:17 GMT Message-Id: <202404271303.43RD3HIC045458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 8c81694af438 - stable/14 - linux: ignore setsockopt(IPV6_RECVERR) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8c81694af438fee9071f826efcc9f1633c50ab3d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8c81694af438fee9071f826efcc9f1633c50ab3d commit 8c81694af438fee9071f826efcc9f1633c50ab3d Author: Lexi Winter AuthorDate: 2024-04-22 21:58:11 +0000 Commit: Warner Losh CommitDate: 2024-04-27 12:59:46 +0000 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 (cherry picked from commit ca63710d3668cf6f3cb4faf065d8b4eeffa028ad) --- sys/compat/linux/linux_socket.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index a5ed5c5c62db..705a64de8ede 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -501,6 +501,11 @@ linux_to_bsd_ip6_sockopt(int opt) "unsupported IPv6 socket option IPV6_RECVFRAGSIZE (%d)", opt); return (-2); + case LINUX_IPV6_RECVERR: + LINUX_RATELIMIT_MSG_OPT1( + "unsupported IPv6 socket option IPV6_RECVERR (%d), you can not get extended reliability info in linux programs", + opt); + return (-2); /* unknown sockopts */ default: @@ -2110,6 +2115,14 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) name = linux_to_bsd_ip_sockopt(args->optname); break; case IPPROTO_IPV6: + if (args->optname == LINUX_IPV6_RECVERR && + linux_ignore_ip_recverr) { + /* + * XXX: This is a hack to unbreak DNS resolution + * with glibc 2.30 and above. + */ + return (0); + } name = linux_to_bsd_ip6_sockopt(args->optname); break; case IPPROTO_TCP: