From nobody Fri Dec 19 15:12:42 2025 X-Original-To: dev-commits-src-main@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 4dXrcs049Rz6LrMf; Fri, 19 Dec 2025 15:12:45 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXrcr6Vtdz3Vrw; Fri, 19 Dec 2025 15:12:44 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766157164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wT0OuKYatJ302J2IXrVtHCrWn68E/58eLDfz86ljWyw=; b=Qs+9NgYcnPII79zeda1vW9FOcr7aZ5Xxq/6VZ7NkuIOMwZHX0OpfsNIdSBuzSW8p9zIlGM O+N4ziS+sqJnC/F5RjIpSCJoiWo9M1CST+IY7iI8BPRKlzfQ9iMWybK5Nwcp3ERz82zq1f 8bXPcXcFUdAGODJjluYLn1+8OHdi1BlosFhqTj5LPxmQGU6fCIa37cHQkhCqpPK8LBflw4 /uoXLRo32cfLol8wZBkUupLfxWmtMS8tbCTI+66AaO66JyXSZY3Om4F4fdMfPEDX0yVTZz d7bTfGu3BX7MJ6hqCWsn4aGNlyByEKDnSXdq2bg9lMUhHGMAePVHjR/3Ct+xqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766157164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wT0OuKYatJ302J2IXrVtHCrWn68E/58eLDfz86ljWyw=; b=Dw9k+seSWXWfLlPWe8gIZrJRLhLozMkIC1XFiMChMPBjZhQ07wILKCF4t1TceWPwgh6Ezv w+eWOsGvtXKiONZvdp6D7x8fVwbMwBWXtEI0Ss5KEG4XZ473aMOrrT/EsYEXoktUgnA1sF ePDHo30k5ufLBC1g4ttMrKpvf8Ws2N49ejJiwWeB2y5YDCXc0i4kM78KHTrVZVRbryeHgn bzPVg/EPR+ZZlW55KqIJwPeCXKWxYDTLOm/BztAIo3/aSYgxlNgZZwl9KPwiMtaGMTHbM6 vaktzXcF5jrglCTCmA9tlHbGFsVJ7UNPbihPVsTrkjkE0mNLbNceUqskLBug4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766157164; a=rsa-sha256; cv=none; b=G5HDsPI7xk9N/VV5K443ZiazJtLwhbLJvABt+N4PK+HzxhdRE1B1OORy/pSuH36e8/a12s v/ffV+MEcZqZrJFiPZtIT3RWSjvkzkID+akz9GhCF6a5e3E0EeeLnCSAq2oUnqjPtUU0cd ww4OlkXNqQvpRwZtFYUVxxBmajUXSVu3AXBp0iToDcgk/vWInw2z7lHGnyKuOZh7kODuMj qafepYLiRQqi/bs2INffuVeuNTfkWyadVKXIDTNbUhnLomqENh8Tg7JJk3SZygnunQ4m6N klQ8PawJGU8Qo3JpG8Bzg26cd/lRxYW2oY047HYfmLWpYjRdukt2c2fko/D+MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (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) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4dXrcr4pDTzmmD; Fri, 19 Dec 2025 15:12:44 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Fri, 19 Dec 2025 10:12:42 -0500 From: Mark Johnston To: Konstantin Belousov Cc: Gleb Smirnoff , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e967a2a03677 - main - sockets: remove compat shim for divert(4) Message-ID: References: <693a275a.2e7b3.1858af56@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 11, 2025 at 05:39:33AM +0200, Konstantin Belousov wrote: > On Thu, Dec 11, 2025 at 02:07:22AM +0000, Gleb Smirnoff wrote: > > The branch main has been updated by glebius: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e967a2a03677f67d46b458d233a6e93c40d173c9 > > > > commit e967a2a03677f67d46b458d233a6e93c40d173c9 > > Author: Gleb Smirnoff > > AuthorDate: 2025-12-11 02:03:35 +0000 > > Commit: Gleb Smirnoff > > CommitDate: 2025-12-11 02:03:35 +0000 > > > > sockets: remove compat shim for divert(4) > > > > All known software in ports had been addressed three years ago and the > > shim stays in stable/14 and stable/15 for another couple years with its > > printf(), so all ourliers are expected to conform before 16.0-RELEASE. > > See 8624f4347e8133911b0554e816f6bedb56dc5fb3 for details. > So why breaking the binaries that users might have lingering around? Aside from that, with a PF_DIVERT socket sd it's not possible to call sd.recvfrom() in python (because python doesn't know which sockaddr subtype to use), whereas with a PF_INET divert socket it gives a sockaddr_in with an interface address, for inbound packets. So some applications cannot be quickly repaired. In fact, I'd find it useful to go the other way and add support for socket(PF_INET6, SOCK_RAW, IPPROTO_DIVERT). > Put this single if() under #ifdef COMPAT15, and perhaps remove the printf() > as well. > > > --- > > sys/kern/uipc_socket.c | 11 ----------- > > 1 file changed, 11 deletions(-) > > > > diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c > > index 9eba3ad2e082..8ed5dcc9336a 100644 > > --- a/sys/kern/uipc_socket.c > > +++ b/sys/kern/uipc_socket.c > > @@ -913,17 +913,6 @@ socreate(int dom, struct socket **aso, int type, int proto, > > struct socket *so; > > int error; > > > > - /* > > - * XXX: divert(4) historically abused PF_INET. Keep this compatibility > > - * shim until all applications have been updated. > > - */ > > - if (__predict_false(dom == PF_INET && type == SOCK_RAW && > > - proto == IPPROTO_DIVERT)) { > > - dom = PF_DIVERT; > > - printf("%s uses obsolete way to create divert(4) socket\n", > > - td->td_proc->p_comm); > > - } > > - > > prp = pffindproto(dom, type, proto); > > if (prp == NULL) { > > /* No support for domain. */ >