From nobody Tue Jan 30 18:38:48 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 4TPYpc2wHvz59LBB; Tue, 30 Jan 2024 18:38:48 +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 4TPYpc29WHz4T58; Tue, 30 Jan 2024 18:38:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706639928; 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=GpW3clGmYI2qLTpqPRATToV23Hff1B5ZhIgRi3dCF14=; b=AHAxugOa2Cy4J7p0cSapEeI609OcXIdmupHqsevzvrnlMxJ7FtQP7kkKdWNPS4eueAYwn7 3Wy4/yDgrEtR/dFpDRnz9NKxF4BV5H4s70wyC6odDFixM7wmU/RXqjJGLfdXVAs0/EdWJK LvEZdnjjAXNBodkv1SBpsc9RqViLYXE+To43yYtWesL/yQuD+iyE8fspKypl7Z8Lh6Zr// doxxq9oDZVCTnmk/zjRATl5Tg1UaFTpZ1PYYFCZisS0+Tr/rxnxu2caUg/AowXw2F870rL f4w7I+75c9GReuPkSau8wu4mN8Zf4aymXojByZ9PJtOgRhk3Rg+1x6GZ6otCsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706639928; 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=GpW3clGmYI2qLTpqPRATToV23Hff1B5ZhIgRi3dCF14=; b=gFF/ISajcTI/iHpB8D3x/as6eiBcMpBXmYUnJ5ZJp27Zf0eCftEninFA0jtxJQR5vvcF2f cp39qIE4yBgON2j4Uq/PeATbgWGmWr4fqsMrry/ertA+BHpTnBQbNv7ffts0aqyVmvO5vp r7UO66eqKIwXczLkSVjptO3uxXG0oBhKGfN1pF/zAwry62ehiynlwakenPC67IbVcGxQ88 +15EU11zPP59yHv0AklfK8NErp/zllQeW9M9Z9GyxnzUSffk5dLlP2J8oEP1iDYEt5Cw5U QdXoRlnoGcNG/4kGu1xzgw/SYkNz5c3Lkd4GGQcHiObZZlhbIrmxxArDQ0Ej/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706639928; a=rsa-sha256; cv=none; b=Om3v1H+QmkSmw/bg97ZenpsF7XxkmCZTAMpYzRKZlbTpJefg77MO6EdcvyN4vxBKlsgpwS Ialrz+r2deXiH8BmjlBv96Scf7ZdJzeluLesONnymRorDudVHCbawkmN3die/3pQhbVivn sTp3VOhxhq8s8KzoN4ChZJDtiq+yAZ7Eyy/UwDAYCb3JGOUOFY1CcByskAEdZJNZdYY+dM GL+tl8r6c6VIL/CMhna174dyAEuPLk7xR6YyQik/PkVVNE5ej7feCanHFnDBx0ImTIaITR fWSjWiIb4ZM8efMBGAZcEOvtRRM8K6JAbW9WLvkNRYz1ftkvx+2E0pqfM9RjpA== 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 4TPYpc1FbVzmyr; Tue, 30 Jan 2024 18:38:48 +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 40UIcm91035829; Tue, 30 Jan 2024 18:38:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40UIcmVA035826; Tue, 30 Jan 2024 18:38:48 GMT (envelope-from git) Date: Tue, 30 Jan 2024 18:38:48 GMT Message-Id: <202401301838.40UIcmVA035826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: f79a8585bb06 - main - sockets: garbage collect SS_ISCONFIRMING 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f79a8585bb06a4fabe0aa2458586dc480693ea0c Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=f79a8585bb06a4fabe0aa2458586dc480693ea0c commit f79a8585bb06a4fabe0aa2458586dc480693ea0c Author: Gleb Smirnoff AuthorDate: 2024-01-30 18:09:48 +0000 Commit: Gleb Smirnoff 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