From nobody Fri Jun 24 16:10:29 2022 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 89DD5865566; Fri, 24 Jun 2022 16:10:30 +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 4LV2CV0vWbz3JWN; Fri, 24 Jun 2022 16:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656087030; 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=X7ryiBTW7/nd43mMBTia6wTCT4y6qy0f52dw4eOI390=; b=rg8+FO7LIbvKy88xBfQsztAXcUiU+GnSNlwC8q2AX/N0QUlh4VmeFvZLynYdGHK9BfXPrr 7EFFctVU+RuHZ6bnDOX6sQVSxprHebFQNOaqNNy34ckKx6wHWmrPkBw5mKq3Mo01yCuFD4 a2BAFXKnT9IRtKMcSmOU/12EnumQ8aaTrG9HfJsFve6bQxMQEOlbRm0bePGLamYHwIJxqb DhhXIlUC5XMAcDO4hxcNCPbX9+3dBjiLi9zCwL/flWLHffGfDwVKW7m0/NQEQwnANLkFFw P4XyeXGT1E6dJvLmN4DPW+bVPL6HIyMlpXpE+dlS3BCGodr/cKJeOZ699VcrvQ== 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 C8ABB12C73; Fri, 24 Jun 2022 16:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25OGATI8006089; Fri, 24 Jun 2022 16:10:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25OGATIe006088; Fri, 24 Jun 2022 16:10:29 GMT (envelope-from git) Date: Fri, 24 Jun 2022 16:10:29 GMT Message-Id: <202206241610.25OGATIe006088@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: 7e5b6b391e77 - main - unix/dgram: cleanup uipc_send of PF_UNIX/SOCK_DGRAM, step 1 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 7e5b6b391e77e5a78da40af64dec171a92a00b60 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656087030; 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=X7ryiBTW7/nd43mMBTia6wTCT4y6qy0f52dw4eOI390=; b=KiUhJTk+cRtVeIrz+lhCFjVyqRXpZrYdxjmRSgY7iz7AjQ8900cZiMMQCnesa07q4uBHP/ Opc7eqLB9P1MZEJNPjRY7BryKIUkVMamcWH/Dx7rzQwwn5kR1UrEvJuCEwnXSMJIS4onvM 0dgCkjV4+AmzsKU/He308Mt0GEtDgquJ7LH3PrwcjyrVSfFAe/RMHQ66dpJ+gF0QEMvXeK JXXa176CgYccGHHo9CoVyLFuhpVPUQz1uLmhROqOQ8a5zEBh+H5lXPKYPmQ+yN4LIAGmPo DXPma5EA5GyBfx6cchTbkcWyiZaSFFlf/38t1FmXk2WUMJIgbykgVxarcIFOyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656087030; a=rsa-sha256; cv=none; b=We24GG3sj1xhkuqL9hr4NGklML2zF1c/Tszm4rcyL/HmATK661UWIEk/C88i7t7wRoKXH4 3YACODk8fQJWOi/6eKmkI7pODrOk7yqxcjT6NAfVqLJ1rz1u8/6Gb2zXIwbYrfMuHjVSn8 lt7uS/eoRFCsmGUAWD6p49b25dcZUbh+zSROH+UPLn83sL0fyAkfIFdAcx8L4tGjW95uZ2 PPc9ZUBAkr4oCdmvBM6TmlI9WkwjMNUhVPVtpPXOjPGmLl/zbRJrg6uakTJ+GJ0/FabUEu cjFWtbCICOvA3XEyt6YfXPcqki/9eOiQjX+ffFpOmeFmMfNrKTrStp2QMcqjNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=7e5b6b391e77e5a78da40af64dec171a92a00b60 commit 7e5b6b391e77e5a78da40af64dec171a92a00b60 Author: Gleb Smirnoff AuthorDate: 2022-06-24 16:09:10 +0000 Commit: Gleb Smirnoff CommitDate: 2022-06-24 16:09:10 +0000 unix/dgram: cleanup uipc_send of PF_UNIX/SOCK_DGRAM, step 1 Remove the dead code. The new uipc_sosend_dgram() handles send() on PF_UNIX/SOCK_DGRAM in full. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35294 --- sys/kern/uipc_usrreq.c | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 2e54ee827b8e..5141ca6a2ad3 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1009,56 +1009,6 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, unp2 = NULL; switch (so->so_type) { - case SOCK_DGRAM: - { - const struct sockaddr *from; - - if (nam != NULL) { - error = unp_connect(so, nam, td); - if (error != 0) - break; - } - UNP_PCB_LOCK(unp); - - /* - * Because connect() and send() are non-atomic in a sendto() - * with a target address, it's possible that the socket will - * have disconnected before the send() can run. In that case - * return the slightly counter-intuitive but otherwise - * correct error that the socket is not connected. - */ - unp2 = unp_pcb_lock_peer(unp); - if (unp2 == NULL) { - UNP_PCB_UNLOCK(unp); - error = ENOTCONN; - break; - } - - if (unp2->unp_flags & UNP_WANTCRED_MASK) - control = unp_addsockcred(td, control, - unp2->unp_flags); - if (unp->unp_addr != NULL) - from = (struct sockaddr *)unp->unp_addr; - else - from = &sun_noname; - so2 = unp2->unp_socket; - SOCKBUF_LOCK(&so2->so_rcv); - if (sbappendaddr_locked(&so2->so_rcv, from, m, - control)) { - sorwakeup_locked(so2); - m = NULL; - control = NULL; - } else { - soroverflow_locked(so2); - error = (so->so_state & SS_NBIO) ? EAGAIN : ENOBUFS; - } - if (nam != NULL) - unp_disconnect(unp, unp2); - else - unp_pcb_unlock_pair(unp, unp2); - break; - } - case SOCK_SEQPACKET: case SOCK_STREAM: if ((so->so_state & SS_ISCONNECTED) == 0) {