From nobody Fri Jan 12 15:41:08 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 4TBQjx0VMbz573D9; Fri, 12 Jan 2024 15:41:09 +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 4TBQjw6GX7z4LDC; Fri, 12 Jan 2024 15:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074068; 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=pS/r4xi6pVXEukIxb+xgcHFPMrD6+az4rilbqXxGrNw=; b=WvuLqHgcV4ZzWa5Rvuv0nrzMUV2/gVq5TGQqbfgR8sIrkJJUnAO8pq0svQYGU21Mtmo7Oa 0PIFaTi+vPqQJeE5Lf/96N3gIJqe1tlUNpgLIZRWeYHezvlM4gQRU0uUgLtG2U8gmDufCC dQ+NaWGS9yFHBaCWNCgd3GolQXY0UAZe3HilkMPPKsm5yDM3WZigMdFvjCeL8chtZpKkKE t3i2bS2AZQnVUcUqodYeVjv4QT9emKdGXl1gjPX5MaRfiQOldALOu2GZQN7p/x14KpHOGZ Lmdnpimj0SCIqMbCsNVU62m4g5hcp5UZyLspwlTvqpf4lFBUVHPDeaD+OF/Jdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705074068; 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=pS/r4xi6pVXEukIxb+xgcHFPMrD6+az4rilbqXxGrNw=; b=kFTP6AR83GJftnyXlsfR0sWgGOxV+MaBvbIutoY9iiyg9X2dGCsKBpAXFXfoXBHrOMfPsa kdDT/SEsueep6Y3cvLkHed/MWH8/YDa8FE5BQB1hZhhxZgHAAM1LRj+IGXCMllGPI9KZdj hoPtl/S25QTZPY3Yzs8Yu27D4y3LdnFJBxNrB4jLVYtniJTyzIWAKTxQgNcAKIc24X2sc5 OX8qqX+mcZfMBOlNeorDQi0rAG4MjBdZlJAQD8DJiqoEk9v1+p9RXNPVaaEQveFtabaFeX Mn0unHcO8ybJtMk3SabiRDd4vBQyfihshdUfOQga54TcRhKKBqkWrOVls6qTpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705074068; a=rsa-sha256; cv=none; b=aY9yBXIxMMpJG+R0UAlE1HZVsl55CPgbVgU4uYJAnsnpKR5LHZku6I/lGYLDjg4F6nyeah wTTBfLgtDvgTy/2uTsE8tnI3B4LfsknawR+MZiRwfB/IqbPaiWZUWw6h/tTp9sJ2jCr1rC utwleXaXxH7JaC9vgTF+Lw4jfkN6Spw1vPVCTxk85iJxl22Teve8iX/LbRtl/aQCcSMqld aqeWj9Hl2g8DI5NDY5+BnPH0xFAph1mUrTuScw7aVH44KJGwZ4g+6bShPxA/f4zxSHMGts tlDgl6WPrK+9IBIm7gjOmSATfbJ5pHF3NnU88CzxYjlq+DjupzOlxt/9SDuqrA== 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 4TBQjw5KdZz17L4; Fri, 12 Jan 2024 15:41:08 +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 40CFf8OR071324; Fri, 12 Jan 2024 15:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40CFf8Z6071321; Fri, 12 Jan 2024 15:41:08 GMT (envelope-from git) Date: Fri, 12 Jan 2024 15:41:08 GMT Message-Id: <202401121541.40CFf8Z6071321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 13fbe20942cd - stable/14 - tcp: tcp: allow SOL_SOCKET-level socket options via sysctl interface 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 13fbe20942cd99c77daedd28560adaef4653fefb Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=13fbe20942cd99c77daedd28560adaef4653fefb commit 13fbe20942cd99c77daedd28560adaef4653fefb Author: Michael Tuexen AuthorDate: 2023-12-09 11:57:19 +0000 Commit: Michael Tuexen CommitDate: 2024-01-12 15:28:41 +0000 tcp: tcp: allow SOL_SOCKET-level socket options via sysctl interface When using the sysctl interface for setting a SOL_SOCKET-level socket option, the TCP handler refers to the IP handler, which only handles SO_SETFIB and SO_MAX_PACING_RATE. So call sosetopt(), which handles all SOL_SOCKET-level options. Then you can use tcpsso with SOL_SOCKET-level socket options as expected. Reported by: rscheff Reviewed by: glebius, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42985 (cherry picked from commit bed7633b108930e9e9d2478c75556035938d4e88) --- sys/netinet/in_pcb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index a54b93812c55..b00d61eaecf7 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -3020,7 +3020,11 @@ sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, so = inp->inp_socket; KASSERT(so != NULL, ("inp_socket == NULL")); soref(so); - error = (*ctloutput_set)(inp, &sopt); + if (params->sop_level == SOL_SOCKET) { + INP_WUNLOCK(inp); + error = sosetopt(so, &sopt); + } else + error = (*ctloutput_set)(inp, &sopt); sorele(so); break; }