From nobody Thu Oct 10 12:37:32 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 4XPTmX73NHz5YyrG; Thu, 10 Oct 2024 12:37:32 +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 4XPTmX3C1rz4HY0; Thu, 10 Oct 2024 12:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728563852; 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=bUC9ASwBMDWa6sL9IEqu4e8c3orSiCqM5AvxB8IvLlE=; b=uvR5kkHyUDYo5/x61RySJHMuwTI/LqrrYphbcX64gv29PbvyVQhWDzJ7T+OHBQbT0Mfqm3 GPCWGzPsE4KWQxGOk8tfgXfZ/QYOxQT09ii/xLLATUxPGtczPWgW0nRn+bmsdcOv/kEMI6 GnKRwMo6nYg7PyYIsoh+LjENv4BK+6BllcIuixvCmSfnZBVhl9pRDBr2jvXaXpdGS3pbos VPa48q8yMjySyorSqRMLXqwzQDLpmtqKV9vYkfy8mzonplFolf81ygS7JadpZzQsBnvC9a a2SJg7HPYLiNhuBIlN/6TvcaUPoGuifsv4f5weRo7rcQ8vpTc3pfvbuK+Z/MbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728563852; 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=bUC9ASwBMDWa6sL9IEqu4e8c3orSiCqM5AvxB8IvLlE=; b=PQTKovzDt1iKxnAtzAlepycb5fPEwcOTndkZmE8qxtBUewZI7bjF+kMeCw/FRnm+KUHTDi iV2vpQDsCuN1aNak2b3woLfBM7M9rdSQbSLH4Afows1nb0bHpSMX4wOo0rk/aYQdKQrhnj 36WDI9Yu8KLQqFxZpovd2SYRWHb3cOaMpPhjZAEfxQAC1OEOvRcWxf7irFR0IQEVELdmiH X5T3I72Uj5isazPB6PvRx3s98PG1JLrGwcYbfKAuaXAnBrAj18GLY66KPZkKoGYEgxvoNk 7Zc4rDIYGW6njSIFgd4omtf/vChQ/roqbA5i4OB+B+jy/JKXCC9+CMUwjSuMTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728563852; a=rsa-sha256; cv=none; b=JA9TEAMAXydZWzkN39DVbD1NzjFa3PiD71A1jNQwGrE/T9M0DNUDOcyIHeQjPX5Z51R/Fj vLYT3o36dBKffkIj7l8zTLyBMtN+5OIdhuzbTuA8WMRnnk/VDIAc+M3ym779NKVqJmciuH x6wtAKVlaV4kGZJYnuxIFEY/0Ee/7ShJYGH02y6P0mgIqfACWW7ytCAMsZ41VY44ttdmKU Y3psYAhqVeKlI62bRDwAnVW/fzqSSjx7dQjaIRJacJgUMKlz/SP8gjLBZDduf2LBuvkm/T 8Vnt5442Z0KOX2ILd8K2wmz1DXLb9/IovkLU7AeTqH2ZHV5Lh86bNSNH36sx+w== 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 4XPTmX2qBPzxq5; Thu, 10 Oct 2024 12:37:32 +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 49ACbWRS006879; Thu, 10 Oct 2024 12:37:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49ACbWpZ006876; Thu, 10 Oct 2024 12:37:32 GMT (envelope-from git) Date: Thu, 10 Oct 2024 12:37:32 GMT Message-Id: <202410101237.49ACbWpZ006876@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: 8978a080cfa7 - main - pf: remove redundant arguments to pf_state_key_addr_setup() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/main X-Git-Reftype: branch X-Git-Commit: 8978a080cfa79a51e50591b839f40606d139b2ee Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8978a080cfa79a51e50591b839f40606d139b2ee commit 8978a080cfa79a51e50591b839f40606d139b2ee Author: Kristof Provost AuthorDate: 2024-10-07 12:29:15 +0000 Commit: Kristof Provost CommitDate: 2024-10-10 12:10:42 +0000 pf: remove redundant arguments to pf_state_key_addr_setup() We always pass these values from struct pf_pdesc, which we also pass, so remove the redundant arguments. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 216d5805b11e..f5b90424d246 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -330,8 +330,7 @@ static int pf_create_state(struct pf_krule *, struct pf_krule *, struct pf_kstate **, int, u_int16_t, u_int16_t, struct pf_krule_slist *, struct pf_udp_mapping *); static int pf_state_key_addr_setup(struct pf_pdesc *, - struct pf_state_key_cmp *, int, struct pf_addr *, - int, struct pf_addr *, int); + struct pf_state_key_cmp *, int); static int pf_tcp_track_full(struct pf_kstate **, struct pf_pdesc *, u_short *, int *); static int pf_tcp_track_sloppy(struct pf_kstate **, @@ -1562,9 +1561,10 @@ pf_state_key_ctor(void *mem, int size, void *arg, int flags) static int pf_state_key_addr_setup(struct pf_pdesc *pd, - struct pf_state_key_cmp *key, int sidx, struct pf_addr *saddr, - int didx, struct pf_addr *daddr, int multi) + struct pf_state_key_cmp *key, int multi) { + struct pf_addr *saddr = pd->src; + struct pf_addr *daddr = pd->dst; #ifdef INET6 struct nd_neighbor_solicit nd; struct pf_addr *target; @@ -1590,28 +1590,28 @@ pf_state_key_addr_setup(struct pf_pdesc *pd, target = (struct pf_addr *)&nd.nd_ns_target; saddr = target; if (IN6_IS_ADDR_MULTICAST(&pd->dst->v6)) { - key->addr[didx].addr32[0] = 0; - key->addr[didx].addr32[1] = 0; - key->addr[didx].addr32[2] = 0; - key->addr[didx].addr32[3] = 0; + key->addr[pd->didx].addr32[0] = 0; + key->addr[pd->didx].addr32[1] = 0; + key->addr[pd->didx].addr32[2] = 0; + key->addr[pd->didx].addr32[3] = 0; daddr = NULL; /* overwritten */ } break; default: if (multi == PF_ICMP_MULTI_LINK) { - key->addr[sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[sidx].addr32[1] = 0; - key->addr[sidx].addr32[2] = 0; - key->addr[sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = 0; + key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; saddr = NULL; /* overwritten */ } } copy: #endif if (saddr) - PF_ACPY(&key->addr[sidx], saddr, pd->af); + PF_ACPY(&key->addr[pd->sidx], saddr, pd->af); if (daddr) - PF_ACPY(&key->addr[didx], daddr, pd->af); + PF_ACPY(&key->addr[pd->didx], daddr, pd->af); return (0); } @@ -1628,7 +1628,7 @@ pf_state_key_setup(struct pf_pdesc *pd, return (NULL); if (pf_state_key_addr_setup(pd, (struct pf_state_key_cmp *)sk, - pd->sidx, pd->src, pd->didx, pd->dst, 0)) { + 0)) { uma_zfree(V_pf_state_key_z, sk); return (NULL); } @@ -6818,8 +6818,7 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, key->port[pd->sidx] = type; key->port[pd->didx] = icmpid; } - if (pf_state_key_addr_setup(pd, key, pd->sidx, pd->src, - pd->didx, pd->dst, multi)) + if (pf_state_key_addr_setup(pd, key, multi)) return (PF_DROP); STATE_LOOKUP(key, *state, pd);