From nobody Sat Dec 09 12:03:58 2023 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 4SnRW22sBVz53tb5; Sat, 9 Dec 2023 12:03:58 +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 4SnRW22FK4z3F7x; Sat, 9 Dec 2023 12:03:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702123438; 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=ZgCPNv/ssM954tE7XWNlOOkNU+xWBpvem6STelGNjYc=; b=M+ud4sss7W5vPqRTMO5BSsB0tz5DF9aQ+4Q/CYikq8OMQwG4u3O/qC1BDQBUA+YfgwDLEm jexO4NrkIgP28km6Z5aFSUpi4oPVSTgl7RaWp/ZN3sRWsZNboDvk514LPO450R4Edo9Zjd fFpBiIXNzTQbgthX60pD5XHj1sSQu6EXacx/N0QhpdDz1w0qIqaUEbzpgxznAAsD8Dqw+c sZR7tAyEaofvpMln1ABlikWNE/hVaMxEjcKmPZSeNViGvfB5BHmUQ1PTair1OmkffzIrct CzTx33g3PYpZcImhRR19STqbZkcuBssWktet1dxUfcmnCHx/hksv/LE1ThtkzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702123438; a=rsa-sha256; cv=none; b=mK6g78NUzMNwpQhp0wQeHstF3kYunHPiJ2xewOA0lxGIbstby2ejDRlSDc1ISwykZNFcst gspBR3emP4jiCJSfkzzbTYGRAOkTCKIfy05h+gR85OzbaI5s3Us6uW+yhvdL/A0M+bekkr 4CR2mSChUDAKvT7EUPnR/srU54hzde0Kuw/TXNzyvi7TrEKCeUmOODGGQS3kCT3FCWfv08 0U7cyF7LusCZsf6fGL1RYYQFidw4+RfuXFxRyKHZ20VB0Lud5nuEFze95f2yIBHwNVKz7C dqQuK/F++OffC2U4yngo8FDw8tNDwiuhUyPJ9QX7dHbloILDQ9l4kBj+RFlFeA== 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=1702123438; 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=ZgCPNv/ssM954tE7XWNlOOkNU+xWBpvem6STelGNjYc=; b=pmqJoPrTUWQ/9DaPgPQImqfXDxPMV4IYPcXnEH9dsnfGgNDzQt18DaE6GDdrMD4ePll8X3 llSvC/tr56zBUoFqXt5utoC/SX7KS1leOq6MWHB5ATOBQwGqEYafUcmnswFjCPHs9Ny47C dC24WkzHWzvMDo/Ip3L2c47AcbZ6mJCzUZQJ8K6obEQggHA/IouNSpSxIhOFVm2CM68/a3 lMCmP8wzMOdGkKBVIjyV+nvfYlJ+idvPG1UqCsOdQsRm53IcdCoLWyakyoTNJymG/hhhzo kuZW3cM3y2EA2+QGHr6gUioi+7MUhoZM20Ii9S4GpugC3VGDOWxtUpgFEopE1Q== 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 4SnRW21HjJz13mP; Sat, 9 Dec 2023 12:03:58 +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 3B9C3wal030534; Sat, 9 Dec 2023 12:03:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B9C3wxj030531; Sat, 9 Dec 2023 12:03:58 GMT (envelope-from git) Date: Sat, 9 Dec 2023 12:03:58 GMT Message-Id: <202312091203.3B9C3wxj030531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: bed7633b1089 - main - tcp: tcp: allow SOL_SOCKET-level socket options via sysctl interface 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bed7633b108930e9e9d2478c75556035938d4e88 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bed7633b108930e9e9d2478c75556035938d4e88 commit bed7633b108930e9e9d2478c75556035938d4e88 Author: Michael Tuexen AuthorDate: 2023-12-09 11:57:19 +0000 Commit: Michael Tuexen CommitDate: 2023-12-09 12:03:51 +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 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D42985 --- 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 797c0dc445dd..0d763184f68c 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2984,7 +2984,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; }