git: 5bf78497dc3a - main - socket: Remove the divert(4) socket compat shim again

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 08 Oct 2026 18:19:20 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=5bf78497dc3ad24197e4940c91ab7c06230af86b

commit 5bf78497dc3ad24197e4940c91ab7c06230af86b
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-08 17:10:32 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-10-08 18:19:08 +0000

    socket: Remove the divert(4) socket compat shim again
    
    Python in the ports tree now handles PF_DIVERT sockets properly; see
    ports commit 4d84480d7a68.  I no longer have any specific reason to keep
    the shim and Gleb wants to remove it, so, let's remove it.
    
    This reverts commit cb7009867ae6b33aa39cb6cb1453b69073144b44.
    
    Requested by:   glebius
    Reviewed by:    glebius
    Differential Revision:  https://reviews.freebsd.org/D60390
---
 sys/kern/uipc_socket.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 17f36ae69125..dc4db57c07e2 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -989,13 +989,6 @@ socreate(int dom, struct socket **aso, int type, int proto,
 	struct socket *so;
 	int error;
 
-#ifdef COMPAT_FREEBSD15
-	/* divert(4) historically abuses PF_INET.  Use PF_DIVERT instead. */
-	if (__predict_false(dom == PF_INET && type == SOCK_RAW &&
-	    proto == __IPPROTO_DIVERT))
-		dom = PF_DIVERT;
-#endif
-
 	prp = pffindproto(dom, type, proto);
 	if (prp == NULL) {
 		/* No support for domain. */