From nobody Fri Feb 21 12:43:21 2025 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 4YzqYP2XyQz5plp1; Fri, 21 Feb 2025 12:43:21 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzqYP1yKLz3wWD; Fri, 21 Feb 2025 12:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740141801; 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=+4SYM7CdSjWp5vuW11YCB3L7975kT7YZuwoO2RJSllc=; b=nZjFbaWI5Crph8XO3oVyfhuDA3nX0EFS8lRrMUoW5+7MuNfNMYrobGe4U0UFKUSE8A4tsG ACczxhifkvbntkuU3/802l8RSsXMIYZ0oqcVEx+l4H0W4ggAFoyw8RcusIWYyoW/Cl4Utr 979ek+0w45cgxO672X81hF1oWzV/Jv3MpYcjnCYh2Z7FsEhGidFx2NVP44irJcxReXDHCY eU67+lhsTg3u4h/H+2JIA+I+tOX77LEFCD0ymeQC4xYgR44ByWGrtZwqR61Fp4llAI6Ncn XsL1JJf55YM399AApdRuOsWPxxjOb6FgU52VgxSRPin87F0JqPWtmGYlo1kBIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740141801; a=rsa-sha256; cv=none; b=aIgZxM1LQTsFYmhbEExbb3hiPOoMQVUOOugN8YmCZIiR7ilXufTOp02Ttk/bfx/BxnWc9D scqh9PuLgQ+DI4nBtkRvkira5aTM3jLe0nUGCsfizELQQUaLBouI5t61Ou81Zb+YtzXO1G CEkkY6YFwN24lf/BBYi0wwJ/tJRYmqIqP3BYKgfMbtjW7fnDPHHuuxt8m0refigmUusVNh Bx7gq53XNx86c2fXh7UvOcqJf2p20+Gmf20jm0LNnX7+JnU8A5LThrbwRcT/iw/98zwvfB 0/KWHr9hSM9gVc4gDM7gIjy6O166cIlK6mvE3hpviEk4v9yH+M+pxG1qPtVNrQ== 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=1740141801; 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=+4SYM7CdSjWp5vuW11YCB3L7975kT7YZuwoO2RJSllc=; b=sHTbnowQyGsrumebqJ9YBBM0KQoBjhp14emFSqeqf/JDi3ml9KUoUhlyClDKBY/CmQDXzV 0jK5+Qw8Cf/U6DjToQpESLIHyQN4yeOtTLCqbZxK5CqGjL/0aFc8eXwZZ+oh3SKVrbypyZ 0m8MyWY/4BKJs4kXyEqxIIMLysWemWUfD9Pcbf1RZL/YXW5Jmwy8SOdCQ2Euba7A+Mencp WH6sriibxJQNEjS77qgBCBMfIDVrBvd4bWSZe18x+COK9r1itHpV337BofykE9VkY/II11 ChJtlEaoJ9jefDTFTiDEcZvHhthg4GTddnuWe9u0iZ6KvpauyhCdvMutSXS1Yg== 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 4YzqYP1XfLz6tZ; Fri, 21 Feb 2025 12:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51LChLdF082971; Fri, 21 Feb 2025 12:43:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LChLpG082968; Fri, 21 Feb 2025 12:43:21 GMT (envelope-from git) Date: Fri, 21 Feb 2025 12:43:21 GMT Message-Id: <202502211243.51LChLpG082968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5dad98d56282 - main - pf: remove redundant argument from pf_icmp_state_lookup() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5dad98d56282d5ea752375dbdfb1d4a57ec5ae23 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dad98d56282d5ea752375dbdfb1d4a57ec5ae23 commit 5dad98d56282d5ea752375dbdfb1d4a57ec5ae23 Author: Kristof Provost AuthorDate: 2025-02-21 10:38:33 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 10:38:33 +0000 pf: remove redundant argument from pf_icmp_state_lookup() We already pass struct pf_pdesc to pf_icmp_state_lookup(). There's no need to also pass the direction. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f9715cd18166..610e65026c28 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -358,8 +358,7 @@ static int pf_test_state(struct pf_kstate **, struct pf_pdesc *, u_short *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, - int, u_int16_t, u_int16_t, - int, int *, int, int); + u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pf_pdesc *, u_short *); static int pf_sctp_track(struct pf_kstate *, struct pf_pdesc *, @@ -7568,10 +7567,11 @@ pf_multihome_scan_asconf(int start, int len, struct pf_pdesc *pd) int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, int direction, - u_int16_t icmpid, u_int16_t type, int icmp_dir, + struct pf_kstate **state, u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, int inner) { + int direction = pd->dir; + key->af = pd->af; key->proto = pd->proto; if (icmp_dir == PF_IN) { @@ -7657,15 +7657,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, * ICMP query/reply message not related to a TCP/UDP/SCTP * packet. Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, pd->dir, - virtual_id, virtual_type, icmp_dir, &iidx, - 0, 0); + ret = pf_icmp_state_lookup(&key, pd, state, virtual_id, + virtual_type, icmp_dir, &iidx, 0, 0); if (ret >= 0) { MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { ret = pf_icmp_state_lookup(&key, pd, state, - pd->dir, virtual_id, virtual_type, + virtual_id, virtual_type, icmp_dir, &iidx, 1, 0); if (ret >= 0) { MPASS(*state == NULL); @@ -8318,8 +8317,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &icmp_dir, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, - pd2.dir, virtual_id, virtual_type, - icmp_dir, &iidx, 0, 1); + virtual_id, virtual_type, icmp_dir, &iidx, 0, 1); if (ret >= 0) { MPASS(*state == NULL); return (ret); @@ -8423,15 +8421,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &icmp_dir, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, - pd->dir, virtual_id, virtual_type, - icmp_dir, &iidx, 0, 1); + virtual_id, virtual_type, icmp_dir, &iidx, 0, 1); if (ret >= 0) { MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { ret = pf_icmp_state_lookup(&key, &pd2, - state, pd->dir, - virtual_id, virtual_type, + state, virtual_id, virtual_type, icmp_dir, &iidx, 1, 1); if (ret >= 0) { MPASS(*state == NULL);