From nobody Mon Apr 08 20:29:43 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 4VD10l3SNnz5HjN3; Mon, 8 Apr 2024 20:29:43 +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 4VD10l1ZcTz45yc; Mon, 8 Apr 2024 20:29:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712608183; 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=J/YduWCkZwouVTT3HlKv7Ooi56crpIZr04F5p4Rb7Hs=; b=vxqRdt4lVwGinY9Yc8PXglasLZXwtWiwSP0NsFt3HwK5F6w7WDyRWWuweKP7QiQVtewtRU n31En+T7uo5UOKGcj8i/DZ5nb7UviGWqBTrWTl/iXAmxcpVr00SaKgHdQsFsXZ2nBj3Q5+ 0Cwp6g+3gr7a7laVELLQ8OPbMaNGo/vcqSl2lH3SyP8ud8rhD+9O1LB+UdoSpr5oX4V0fM my4N5HNj8Ptj3dQpRw23tZ8fxlEvgBxG8T9ez2T3RWDvQQdf3Gcr85TEXpHCzE9B8gArc0 m7Ri9qZ8hGrsoN6gO+FGcP70Lfy1KIZsIiaJH2VcB/mbj37PRirqVkNTC7BcwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712608183; a=rsa-sha256; cv=none; b=BIrc3X+7uDAuiOcuDSEII9PEAmiuMg68YfPwPXptM6+ThDnXHB+t0AaO2+7+mvo1/TlMEy cRbDJUbRSA+ej3M9MRZ9p0qKKf2lbNSQX0Xfu/MdykBbNI4EGAkc2mGd4WTpZHMEBWDhdi ZWtIFBid5f02+N+hsxycq8QNL8dnTi8ctm2tYzOqcYHvb3mspf++DkYOQ7SEJyYViVLoHC YIXBjUyrjQkm4421JcRbQ8+qC4QNxevlLT3Z9ZSkawrk55DvFCZ5jdg9+zwgXYfoLT+9mL zfRPimirl4xpAa5RYi/Z+lWxudLnAwkI5zQlulIrsBe1JbOaRAqplTYOe2INvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712608183; 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=J/YduWCkZwouVTT3HlKv7Ooi56crpIZr04F5p4Rb7Hs=; b=rePXawg9Ltgf5pkcLISdKFPbINAV2o33kbqeFj+qKgwE95MBS6diHNP7SnPlYw02aR/eRN ebCKeE5ELTWXgEvw/4cEozDMgoqgSuB55c2LcCm5GqD/3fQnZkWF/FAF4YAOx9VEdv/mE8 kyaHmUOI0gQwwvhgFj56TCUbWs9gOehKHUbBqhTdGhTbI9jUohFbRe5FYLmuQI68bOtLJ4 s8J/3a/IjtZB4q6jFV/3SlUY/0hFslI31ntbTjLaS4elIVDJNNrv7rtI3MoqS3hCnhvqGB N/Jpx4LoGBEicJ5/Zai0ub/untd7YetqiFgQ2f58WoSpd70hXxc2OvyMETS3Zw== 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 4VD10l15rWzQg2; Mon, 8 Apr 2024 20:29:43 +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 438KThsC041618; Mon, 8 Apr 2024 20:29:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 438KThIr041615; Mon, 8 Apr 2024 20:29:43 GMT (envelope-from git) Date: Mon, 8 Apr 2024 20:29:43 GMT Message-Id: <202404082029.438KThIr041615@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: 3b7aa842e27d - main - sendfile: mark it explicitly as a TCP only feature 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: 3b7aa842e27dcf07181f161b1abde0067ed51e97 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3b7aa842e27dcf07181f161b1abde0067ed51e97 commit 3b7aa842e27dcf07181f161b1abde0067ed51e97 Author: Gleb Smirnoff AuthorDate: 2024-04-08 20:16:51 +0000 Commit: Gleb Smirnoff CommitDate: 2024-04-08 20:16:51 +0000 sendfile: mark it explicitly as a TCP only feature Back in 2015 when it turned non-blocking, it was working with PF_UNIX and it may still work. However, the usefullness of such application of sendfile(2) is questionable. Disable the feature while unix/stream is under refactoring. Relnotes: yes --- sys/kern/kern_sendfile.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index 323e7fcde07b..071c2fbbd436 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -649,20 +649,16 @@ sendfile_getsock(struct thread *td, int s, struct file **sock_fp, *sock_fp = NULL; *so = NULL; - /* - * The socket must be a stream socket and connected. - */ error = getsock(td, s, &cap_send_rights, sock_fp); if (error != 0) return (error); *so = (*sock_fp)->f_data; - if ((*so)->so_type != SOCK_STREAM) - return (EINVAL); /* - * SCTP one-to-one style sockets currently don't work with - * sendfile(). So indicate EINVAL for now. + * sendfile(2) should be supported for every SOCK_STREAM socket. + * However, the support of PF_UNIX/SOCK_STREAM is temporarily degraded + * and IPPROTO_SCTP isn't supported, yet. */ - if ((*so)->so_proto->pr_protocol == IPPROTO_SCTP) + if ((*so)->so_proto->pr_protocol != IPPROTO_TCP) return (EINVAL); return (0); }