From nobody Mon Aug 28 12:03:20 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 4RZ8Mr5wgpz4rTlX; Mon, 28 Aug 2023 12:03:20 +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 4RZ8Mr4TZ8z3dbR; Mon, 28 Aug 2023 12:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224200; 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=Yl9LtXkrqTEqC0PAsWkbuMBowwfijzqBsi5cqNxTWe0=; b=mSXi1uMeuE4kj/h67clcNiqOThZDdxzivmCPur/di9T0sf3IzJ1ShKfTpMiSYvgu6jVoJA +DgtRhc+A0/odwDxsdI4PBE7gIDbG0S5XZjrcWmjJbr+SXmm9r0gURYCPPLe9ZdKbWpzA/ VlAGoBoH0iuv0hcYTrHmUhpqy2KousyletkrdaHmITkudl9bIzVYtb/HTpDN5nMRpEt7CE r/XkXdvP1poFRkHqp6aTBLz1aJqXiZh7AmL7K1Ty6MYePSl6pOviwAzmME8iXIJBCWN3D2 2t7CdzzAhlVug5jb7q2TFaYPqqNF4/6fwFeOsVWLmMHUF7D4zhqPOQr3x+irSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693224200; 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=Yl9LtXkrqTEqC0PAsWkbuMBowwfijzqBsi5cqNxTWe0=; b=LTmnaWeRmoVHnY5bFIM/tLllpOINbLVqfkir7XcnN+zGVatLCETS2s2SXks31EmjD2wfxh Nm1Bc20i+LwKXRaq3ubzEl3SXD42nGyMNDibVQAQRxujtVzu5sVZjciab6gjbckxuoWbMv IsmxTx3ai3tUEKNPytmRp/LNL5faM7ij+n5vcgNLdj0+cNmk2HHNChmfJXB1ZEkqS3hQT+ WQU19kHb8VS7zHsHxnqkRPKiIpk8Yo+bMNhMjn60qWrMTy8N79SvuoVr7BXRi8HXBFJeiX XpWJ5gLItlmaD5FbM3UTlSQMf7zpb5OMt6IC4boyIxuSz+dLFSQ/eQgS0tQuTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693224200; a=rsa-sha256; cv=none; b=p2JXJrfzGoXouLfPD51PGvjt9SCYsyzs3do6LUh/hjq1M5xywJkDjlrVcwAAZ+eSevFiFs 1fCM1Ei8dAHd6fR4qM6YsaQ1DX7QmdR8JHX/K6uaJMCCxtD6eaXspKLayD9/YGV9jVkXXj kgTJtAmb1Lmts1ra57TDGEBDkNOujIiE8Uv914c520FAEwk4Vkg0QBTUBYl3ScFkrISoAw //9V3/q0piZWQMVRBiBYYipJZxRw1iu3s82ojsHq9hTvANefHR9cRA2OvIF8qvo/O7/c+s sHp5+swcCaTWW5y7z2MBUVEFGmxzKLXCa+E8TJKAQobhy7blqZ+6UdcK79D77g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RZ8Mr39pkz17MT; Mon, 28 Aug 2023 12:03:20 +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 37SC3KSF030433; Mon, 28 Aug 2023 12:03:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37SC3KuO030430; Mon, 28 Aug 2023 12:03:20 GMT (envelope-from git) Date: Mon, 28 Aug 2023 12:03:20 GMT Message-Id: <202308281203.37SC3KuO030430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: ed3875392697 - stable/13 - pf: reduce indentation 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed38753926973fbd84135523efefcfcb887064ee Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ed38753926973fbd84135523efefcfcb887064ee commit ed38753926973fbd84135523efefcfcb887064ee Author: Kajetan Staszkiewicz AuthorDate: 2023-08-21 05:59:49 +0000 Commit: Kristof Provost CommitDate: 2023-08-28 08:17:18 +0000 pf: reduce indentation Early-return to reduce syncookie-related indentation. No functional change. MFC after: 1 week Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D41502 (cherry picked from commit 9642d948c08d80a41679f2eaab26e85a8b9e3080) --- sys/netpfil/pf/pf.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0717c0ac0992..9c1d11952a90 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6729,8 +6729,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * pd.dir == PF_IN) { struct mbuf *msyn; - msyn = pf_syncookie_recreate_syn(h->ip_ttl, - off,&pd); + msyn = pf_syncookie_recreate_syn(h->ip_ttl, off, + &pd); if (msyn == NULL) { action = PF_DROP; break; @@ -6738,29 +6738,22 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * action = pf_test(dir, pflags, ifp, &msyn, inp); m_freem(msyn); + if (action != PF_PASS) + break; - if (action == PF_PASS) { - action = pf_test_state_tcp(&s, dir, - kif, m, off, h, &pd, &reason); - if (action != PF_PASS || s == NULL) { - action = PF_DROP; - break; - } - - s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - - 1; - s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - - 1; - pf_set_protostate(s, PF_PEER_SRC, - PF_TCPS_PROXY_DST); - - action = pf_synproxy(&pd, &s, &reason); - if (action != PF_PASS) - break; + action = pf_test_state_tcp(&s, dir, + kif, m, off, h, &pd, &reason); + if (action != PF_PASS || s == NULL) { + action = PF_DROP; + break; } + + s->src.seqhi = ntohl(pd.hdr.tcp.th_ack) - 1; + s->src.seqlo = ntohl(pd.hdr.tcp.th_seq) - 1; + pf_set_protostate(s, PF_PEER_SRC, PF_TCPS_PROXY_DST); + action = pf_synproxy(&pd, &s, &reason); break; - } - else { + } else { action = pf_test_rule(&r, &s, dir, kif, m, off, &pd, &a, &ruleset, inp); }