From nobody Sat May 06 09:23:49 2023 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 4QD2DQ2LVQz49LQ2; Sat, 6 May 2023 09:23:50 +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 4QD2DQ1dCwz3r75; Sat, 6 May 2023 09:23:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683365030; 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=NqeBFCNnmpIpL6AzKweDnoNiMaoI2dvrkIxl9gybKTI=; b=IW9PegErOpRLC3mAObBcmAsslgKW4qf7l6eq/Cw8pupfIEuIrn/PNtT6BzfZoou5MKKldA +N6QLUSHhIoAZ1/yC7s+VUfUxEYNOnSl/9cpBRZ3OGYFMHGFGKiqrd3hyG9TPk/O9sBoXq mAnO+mnyJFVFYOSIdhWiSNUOicbfZVdfAB7AMkjemxXeFhi8pJOQCcWKMCHMzgahFcYzog yEtBSCNvex1nc42Dy/LoEOLEaX+HcfpmKbqoGM6+NEqKT1vt+VoFI0XFup0O3kFKkE2zWB 2dty9qhMf5A7kjLrgoHTPk0VFw2HD9nzEOTc6I4xnRXkD5G2j8UP4u/b0Uw4+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683365030; 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=NqeBFCNnmpIpL6AzKweDnoNiMaoI2dvrkIxl9gybKTI=; b=ppe7FshZl20gLIo58AkHL6b5mdn5eLPwPUXCBxkd5Q39YJAp3RSK+B7Zp8aru4N/BYdqAZ KaFZbp+gfoNHxv3b9v7zG4rjJrPGd7a1P1RJWMbLqKPh6xhI2ULgbA57T7wmAGB6kH7ka2 unr9pjT5kb9ZyHXae+ybiHHO8K/caVUbaPIwwB9uMIQ9X8FJDlbmG+6j9guotR+RyyzFNt XgLo0IqlAJhpY8oRXDO6vYQD/KtqJjLE5gy/8n5vy0Caag7nBg1LQLW/gfe/L3qbRceYpL wogDLtWxqlcqSgBYxn8RMvpWxM3WbAK+YduyoRpyCoL7dhtBX3DqaxFGO+6gew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683365030; a=rsa-sha256; cv=none; b=UEvOCEeZw1ludPoyXOns4isDI3qrpsbIHYtkzW2mNcbSN9GTnbgVmcqz3qOc3oj2xyByrc 8l8UgZuT3npGN4sBWPMcbpZYEFLRYr9lKt4vgAdNvwhruKHgI0D4pFf2YCe3hgVuskZ+7k hSWUIZxR/l1ZBDL3SA4VSq9Ifn5aT3LfXdqpAnvk5bwQJEa7e4Bl7k7kdTalmwV75BMA4J 7EPFVQOFh3RVkrs0s/Ibk3kJeREAVfPVFVDX6MgrKU7rb8MUcndhPU+tJuYwyYhOhJOV4I UtsCZKAgReR7yUlr+FvwDWEOrr4IzwZeAQEOwruyX4k+ePJdJR/kei3xGJ5BQg== 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 4QD2DQ0hDgzWp4; Sat, 6 May 2023 09:23:50 +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 3469NoFs094523; Sat, 6 May 2023 09:23:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3469NnZP094522; Sat, 6 May 2023 09:23:49 GMT (envelope-from git) Date: Sat, 6 May 2023 09:23:49 GMT Message-Id: <202305060923.3469NnZP094522@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: e044a0bce495 - main - bblog: inherit TCP_LOG option from listener 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/main X-Git-Reftype: branch X-Git-Commit: e044a0bce4953ed9a98af73fa98dd16d04a9c5ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e044a0bce4953ed9a98af73fa98dd16d04a9c5ed commit e044a0bce4953ed9a98af73fa98dd16d04a9c5ed Author: Michael Tuexen AuthorDate: 2023-05-06 09:21:16 +0000 Commit: Michael Tuexen CommitDate: 2023-05-06 09:21:16 +0000 bblog: inherit TCP_LOG option from listener When the TCP_LOG option is used to enable logging on a listening socket, inherit this if the listener is not auto selected and does not have a log id set. Reviewed by: cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D38436 --- sys/netinet/tcp_syncache.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 54a347c2669e..5fc63d42b21a 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -90,6 +90,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_BLACKBOX +#include +#endif #ifdef TCP_OFFLOAD #include #endif @@ -1013,6 +1016,20 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) tod->tod_offload_socket(tod, sc->sc_todctx, so); } +#endif +#ifdef TCP_BLACKBOX + /* + * Inherit the log state from the listening socket, if + * - the log state of the listening socket is not off and + * - the listening socket was not auto selected from all sessions and + * - a log id is not set on the listening socket. + * This avoids inheriting a log state which was automatically set. + */ + if ((tcp_get_bblog_state(sototcpcb(lso)) != TCP_LOG_STATE_OFF) && + ((sototcpcb(lso)->t_flags2 & TF2_LOG_AUTO) == 0) && + (sototcpcb(lso)->t_lib == NULL)) { + tcp_log_state_change(tp, tcp_get_bblog_state(sototcpcb(lso))); + } #endif /* * Copy and activate timers.