Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2024 18:38:48 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f79a8585bb06 - main - sockets: garbage collect SS_ISCONFIRMING
Message-ID:  <202401301838.40UIcmVA035826@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

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

commit f79a8585bb06a4fabe0aa2458586dc480693ea0c
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2024-01-30 18:09:48 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-01-30 18:38:33 +0000

    sockets: garbage collect SS_ISCONFIRMING
    
    Fixes:  8df32b19dee92b5eaa4b488ae78dca6accfcb38e
---
 sys/compat/linuxkpi/common/include/linux/net.h |  2 +-
 sys/kern/uipc_debug.c                          |  4 ----
 sys/kern/uipc_socket.c                         | 15 ++++-----------
 sys/kern/uipc_syscalls.c                       |  2 +-
 sys/netgraph/ng_ksocket.c                      |  3 +--
 sys/netinet/sctp_pcb.c                         |  1 -
 sys/netinet/sctputil.c                         |  1 -
 sys/rpc/clnt_vc.c                              |  2 +-
 sys/sys/socketvar.h                            |  2 +-
 9 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/net.h b/sys/compat/linuxkpi/common/include/linux/net.h
index dc0b46df9c99..a5172f3f31eb 100644
--- a/sys/compat/linuxkpi/common/include/linux/net.h
+++ b/sys/compat/linuxkpi/common/include/linux/net.h
@@ -56,7 +56,7 @@ sock_getname(struct socket *so, struct sockaddr *sa, int *sockaddr_len,
 	 * length.  Such notion doesn't even exist in Linux KPI.
 	 */
 	if (peer) {
-		if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0)
+		if ((so->so_state & SS_ISCONNECTED) == 0)
 			return (-ENOTCONN);
 
 		error = so->so_proto->pr_peeraddr(so, sa);
diff --git a/sys/kern/uipc_debug.c b/sys/kern/uipc_debug.c
index 1e699a10223e..83cb7f6dc00a 100644
--- a/sys/kern/uipc_debug.c
+++ b/sys/kern/uipc_debug.c
@@ -176,10 +176,6 @@ db_print_sostate(short so_state)
 		db_printf("%sSS_ASYNC", comma ? ", " : "");
 		comma = 1;
 	}
-	if (so_state & SS_ISCONFIRMING) {
-		db_printf("%sSS_ISCONFIRMING", comma ? ", " : "");
-		comma = 1;
-	}
 }
 
 static void
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 65230e39e4ae..5e5e7d2cd058 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -792,7 +792,7 @@ solisten_clone(struct socket *head)
 	return (so);
 }
 
-/* Connstatus may be 0, or SS_ISCONFIRMING, or SS_ISCONNECTED. */
+/* Connstatus may be 0 or SS_ISCONNECTED. */
 struct socket *
 sonewconn(struct socket *head, int connstatus)
 {
@@ -1516,8 +1516,7 @@ sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio,
 		 */
 		if ((so->so_proto->pr_flags & PR_CONNREQUIRED) &&
 		    (so->so_proto->pr_flags & PR_IMPLOPCL) == 0) {
-			if ((so->so_state & SS_ISCONFIRMING) == 0 &&
-			    !(resid == 0 && clen != 0)) {
+			if (!(resid == 0 && clen != 0)) {
 				SOCKBUF_UNLOCK(&so->so_snd);
 				error = ENOTCONN;
 				goto out;
@@ -1725,8 +1724,7 @@ restart:
 			 */
 			if ((so->so_proto->pr_flags & PR_CONNREQUIRED) &&
 			    (so->so_proto->pr_flags & PR_IMPLOPCL) == 0) {
-				if ((so->so_state & SS_ISCONFIRMING) == 0 &&
-				    !(resid == 0 && clen != 0)) {
+				if (!(resid == 0 && clen != 0)) {
 					SOCKBUF_UNLOCK(&so->so_snd);
 					error = ENOTCONN;
 					goto release;
@@ -2068,11 +2066,6 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio,
 		return (soreceive_rcvoob(so, uio, flags));
 	if (mp != NULL)
 		*mp = NULL;
-	if ((pr->pr_flags & PR_WANTRCVD) && (so->so_state & SS_ISCONFIRMING)
-	    && uio->uio_resid) {
-		VNET_SO_ASSERT(so);
-		pr->pr_rcvd(so, 0);
-	}
 
 	error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags));
 	if (error)
@@ -3862,7 +3855,7 @@ soisconnected(struct socket *so)
 	bool last __diagused;
 
 	SOCK_LOCK(so);
-	so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING);
+	so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING);
 	so->so_state |= SS_ISCONNECTED;
 
 	if (so->so_qstate == SQ_INCOMP) {
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 366698054bce..dce0ab9b53d4 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1412,7 +1412,7 @@ kern_getpeername(struct thread *td, int fd, struct sockaddr *sa)
 	if (error != 0)
 		return (error);
 	so = fp->f_data;
-	if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) {
+	if ((so->so_state & SS_ISCONNECTED) == 0) {
 		error = ENOTCONN;
 		goto done;
 	}
diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
index 98eb19ab485b..388fe9557db3 100644
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -782,8 +782,7 @@ ng_ksocket_rcvmsg(node_p node, item_p item, hook_p lasthook)
 
 			/* Get function */
 			if (msg->header.cmd == NGM_KSOCKET_GETPEERNAME) {
-				if ((so->so_state
-				    & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0)
+				if ((so->so_state & SS_ISCONNECTED) == 0)
 					ERROUT(ENOTCONN);
 				func = sopeeraddr;
 			} else
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index a1742b2fffca..1509ac13901e 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -4851,7 +4851,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int from_inpcbfre
 				SOCKBUF_LOCK(&so->so_rcv);
 				so->so_state &= ~(SS_ISCONNECTING |
 				    SS_ISDISCONNECTING |
-				    SS_ISCONFIRMING |
 				    SS_ISCONNECTED);
 				so->so_state |= SS_ISDISCONNECTED;
 				socantrcvmore_locked(so);
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 19180b3cf725..b23efd9c8968 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -5654,7 +5654,6 @@ restart_nosblocks:
 				}
 				so->so_state &= ~(SS_ISCONNECTING |
 				    SS_ISDISCONNECTING |
-				    SS_ISCONFIRMING |
 				    SS_ISCONNECTED);
 				if (error == 0) {
 					if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) {
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index 69635413637b..8b69117ba2ac 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -153,7 +153,7 @@ clnt_vc_create(
 	ct->ct_upcallrefs = 0;
 	ct->ct_rcvstate = RPCRCVSTATE_NORMAL;
 
-	if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) {
+	if ((so->so_state & SS_ISCONNECTED) == 0) {
 		error = soconnect(so, raddr, curthread);
 		SOCK_LOCK(so);
 		interrupted = 0;
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 5d651b36b1e7..030087cbc17c 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -211,7 +211,7 @@ struct socket {
 #define	SS_ISDISCONNECTING	0x0008	/* in process of disconnecting */
 #define	SS_NBIO			0x0100	/* non-blocking ops */
 #define	SS_ASYNC		0x0200	/* async i/o notify */
-#define	SS_ISCONFIRMING		0x0400	/* deciding to accept connection req */
+/* was	SS_ISCONFIRMING		0x0400	*/
 #define	SS_ISDISCONNECTED	0x2000	/* socket disconnected from peer */
 
 #ifdef _KERNEL



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401301838.40UIcmVA035826>