From owner-svn-src-head@freebsd.org Tue Jan 28 13:51:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D32622D8F0; Tue, 28 Jan 2020 13:51:54 +0000 (UTC) (envelope-from trasz@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 486Shp3djyz3yd4; Tue, 28 Jan 2020 13:51:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7812724027; Tue, 28 Jan 2020 13:51:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00SDpsDb053808; Tue, 28 Jan 2020 13:51:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00SDprlX053805; Tue, 28 Jan 2020 13:51:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001281351.00SDprlX053805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 28 Jan 2020 13:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357202 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2020 13:51:54 -0000 Author: trasz Date: Tue Jan 28 13:51:53 2020 New Revision: 357202 URL: https://svnweb.freebsd.org/changeset/base/357202 Log: Add compat.linux.ignore_ip_recverr sysctl. This is a workaround for missing IP_RECVERR setsockopt(2) support. Without it, DNS resolution is broken for glibc >= 2.30 (glibc BZ #24047). From the user point of view this fixes "yum update" on recent CentOS 8. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23234 Modified: head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_mib.c Tue Jan 28 13:51:53 2020 (r357202) @@ -62,6 +62,10 @@ static unsigned linux_osd_jail_slot; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); +int linux_ignore_ip_recverr = 1; +SYSCTL_INT(_compat_linux, OID_AUTO, ignore_ip_recverr, CTLFLAG_RWTUN, + &linux_ignore_ip_recverr, 0, "Ignore enabling IP_RECVERR"); + int linux_preserve_vstatus = 0; SYSCTL_INT(_compat_linux, OID_AUTO, preserve_vstatus, CTLFLAG_RWTUN, &linux_preserve_vstatus, 0, "Preserve VSTATUS termios(4) flag"); Modified: head/sys/compat/linux/linux_mib.h ============================================================================== --- head/sys/compat/linux/linux_mib.h Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_mib.h Tue Jan 28 13:51:53 2020 (r357202) @@ -62,6 +62,7 @@ int linux_kernver(struct thread *td); #define linux_use26(t) (linux_kernver(t) >= LINUX_KERNVER_2006000) +extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; #endif /* _LINUX_MIB_H_ */ Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_socket.c Tue Jan 28 13:51:53 2020 (r357202) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #include #include #include @@ -1424,6 +1425,14 @@ linux_setsockopt(struct thread *td, struct linux_setso } break; case IPPROTO_IP: + if (args->optname == LINUX_IP_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_ip_sockopt(args->optname); break; case IPPROTO_IPV6: Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Tue Jan 28 13:13:41 2020 (r357201) +++ head/sys/compat/linux/linux_socket.h Tue Jan 28 13:51:53 2020 (r357202) @@ -202,6 +202,7 @@ int linux_accept(struct thread *td, struct linux_accep #define LINUX_IP_TTL 2 #define LINUX_IP_HDRINCL 3 #define LINUX_IP_OPTIONS 4 +#define LINUX_IP_RECVERR 11 #define LINUX_IP_MULTICAST_IF 32 #define LINUX_IP_MULTICAST_TTL 33