From nobody Wed Apr 09 19:30:47 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 4ZXtMt6TzYz5sGWH; Wed, 09 Apr 2025 19:30: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZXtMr0Bt4z45N8; Wed, 09 Apr 2025 19:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744227048; 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=boKdLqqZGlDIj0aW3GMDTu/V0jvWL38sXbEy6CnYmnE=; b=aOi0Qo4OF1xKv6NQKpk2ZtnaxlA4PPyJXw+zS/G4rtqJf8r1szukBFNJnHtgrh5aFomt9A MYoYHQOXQL3wne1s+q7Nwos1rZUDbTmcw+drjk+6FXrNhbD7bOaU5KIOdnsIF9J7cFVMDS m1oatHNHXHawP5506LVI0FkIT90jdvLybvYj7jrYo2b5SM8PyQ4ybALpe80rsnb4VLNRhM 9RNpIOn5RsN7bh1nhI3VipBtCF00/4lngeMb8ucVuoPY11qVdnv6BVXLVwjMJ7meMch2GF URBH1Mh/dq2eZ3JcyKuzSU8uyxHGxIkGfe7j5wk47kzwVZWelEp4Vzawa9YIDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744227048; a=rsa-sha256; cv=none; b=Dp8YhCD5OCjcOgJpILxmULsC9ciEO4wpdpLlIyWtGAlattr066u3439h2PK2F2KhR9sBHy JZx7l6ohM1FdSSEYSp6ZU51qiFost3RmORlk9m6yn4m7Y05xVoowt14r0DpVSqSASVI4/Y hPwdGjE5eWDpOIkD/rhw/pvVTmCfzURT4kr7dnB2bsMmWwWrNRas5A12OS5NNs5NGKNU+Z FfChzPwdc1vORMw9NCE2jeW/2iC/sniQGIWybS1VvwLaVmYzmCEWQ8CYt+98+QhSIOa7+U gcUpZdoOasok5Rg3sht+hiNy1PmrhqCWsjDBo8KtW6oWQ/T28oTNuZUaOeqKfQ== 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=1744227048; 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=boKdLqqZGlDIj0aW3GMDTu/V0jvWL38sXbEy6CnYmnE=; b=gM+a1P/yvuomAX2rp8NKeIZZKCacJpf/iWhEjbKNo0XBi7oFBlKuQoItFBDq+mF3bjYxyu LdPOTE4H6RbegkaCCagZTjMFQUClQo74bwy9nFz/xnz9SEDLjRP+rN4n7YJr4yq6eRPiLu ag5xyYY6iuLGTx/Zx2cOenHIV7pCwARyhk4Y/oCy6cohfhmxgk4ZJgEZOTgEMcoRJNyiPz iAIM24zGVyuaY6zTJgbEZAezSzqEcRAwy/AAweiD3lOjoSsRttyIYVkxKZ4qovmfl+T13N nAsmz7K4WUtvhtEmJJquW/U7f/0bjU9zmETZv/P2EJDqwknuV2TFENlrQdcmVg== 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 4ZXtMq6p07zV14; Wed, 09 Apr 2025 19:30:47 +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 539JUlBe080176; Wed, 9 Apr 2025 19:30:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 539JUldh080173; Wed, 9 Apr 2025 19:30:47 GMT (envelope-from git) Date: Wed, 9 Apr 2025 19:30:47 GMT Message-Id: <202504091930.539JUldh080173@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: ea6432cfa3c4 - main - pf: rename pf_unlink_state() to pf_remove_state() 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: ea6432cfa3c4c56406de5b0060640f9023c210aa Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea6432cfa3c4c56406de5b0060640f9023c210aa commit ea6432cfa3c4c56406de5b0060640f9023c210aa Author: Kristof Provost AuthorDate: 2025-04-09 15:36:16 +0000 Commit: Kristof Provost CommitDate: 2025-04-09 19:30:17 +0000 pf: rename pf_unlink_state() to pf_remove_state() The OpenBSD rationale ('so the name does not collide with the statekey to inp unlinking') doesn't apply to us, but it makes future imports easier if we follow this rename. Obtained from: OpenBSD, bluhm , acb93c8a64 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 2 +- sys/netpfil/pf/if_pfsync.c | 4 ++-- sys/netpfil/pf/pf.c | 14 +++++++------- sys/netpfil/pf/pf_ioctl.c | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 74926581e247..e3a8412bde73 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2331,7 +2331,7 @@ extern void pf_unload_vnet_purge(void); extern void pf_intr(void *); extern void pf_purge_expired_src_nodes(void); -extern int pf_unlink_state(struct pf_kstate *); +extern int pf_remove_state(struct pf_kstate *); extern int pf_state_insert(struct pfi_kkif *, struct pfi_kkif *, struct pf_state_key *, diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index b2aaf3add25c..0795c75e8de0 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1051,7 +1051,7 @@ relock: LIST_FOREACH(s, &ih->states, entry) { if (s->creatorid == creatorid) { s->state_flags |= PFSTATE_NOSYNC; - pf_unlink_state(s); + pf_remove_state(s); goto relock; } } @@ -1440,7 +1440,7 @@ pfsync_in_del_c(struct mbuf *m, int offset, int count, int flags, int action) } st->state_flags |= PFSTATE_NOSYNC; - pf_unlink_state(st); + pf_remove_state(st); } return (len); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index d05469ad959b..fdd412a92135 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1910,7 +1910,7 @@ pf_find_state(struct pfi_kkif *kif, const struct pf_state_key_cmp *key, if (__predict_false(s->timeout >= PFTM_MAX)) { /* * State is either being processed by - * pf_unlink_state() in an other thread, or + * pf_remove_state() in an other thread, or * is scheduled for immediate expiry. */ PF_STATE_UNLOCK(s); @@ -1930,7 +1930,7 @@ pf_find_state(struct pfi_kkif *kif, const struct pf_state_key_cmp *key, if (__predict_false(s->timeout >= PFTM_MAX)) { /* * State is either being processed by - * pf_unlink_state() in an other thread, or + * pf_remove_state() in an other thread, or * is scheduled for immediate expiry. */ PF_STATE_UNLOCK(s); @@ -2730,7 +2730,7 @@ pf_src_tree_remove_state(struct pf_kstate *s) * unlocked, since it needs to go through key hash locking. */ int -pf_unlink_state(struct pf_kstate *s) +pf_remove_state(struct pf_kstate *s) { struct pf_idhash *ih = &V_pf_idhash[PF_IDHASH(s)]; @@ -2740,7 +2740,7 @@ pf_unlink_state(struct pf_kstate *s) if (s->timeout == PFTM_UNLINKED) { /* * State is being processed - * by pf_unlink_state() in + * by pf_remove_state() in * an other thread. */ PF_HASHROW_UNLOCK(ih); @@ -2837,7 +2837,7 @@ relock: LIST_FOREACH(s, &ih->states, entry) { if (pf_state_expires(s) <= time_uptime) { V_pf_status.states -= - pf_unlink_state(s); + pf_remove_state(s); goto relock; } s->rule->rule_ref |= PFRULE_REFS; @@ -6982,7 +6982,7 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason) } /* XXX make sure it's the same direction ?? */ pf_set_protostate(*state, PF_PEER_BOTH, TCPS_CLOSED); - pf_unlink_state(*state); + pf_remove_state(*state); *state = NULL; return (PF_DROP); } @@ -7019,7 +7019,7 @@ pf_test_state(struct pf_kstate **state, struct pf_pdesc *pd, u_short *reason) (dst->state >= SCTP_SHUTDOWN_SENT || dst->state == SCTP_CLOSED) && pd->sctp_flags & PFDESC_SCTP_INIT) { pf_set_protostate(*state, PF_PEER_BOTH, SCTP_CLOSED); - pf_unlink_state(*state); + pf_remove_state(*state); *state = NULL; return (PF_DROP); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 45e6e9f0bb9a..3ee5173c1313 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2296,7 +2296,7 @@ pf_kill_matching_state(struct pf_state_key_cmp *key, int dir) return (0); } - pf_unlink_state(s); + pf_remove_state(s); return (1); } @@ -2393,7 +2393,7 @@ relock_DIOCKILLSTATES: match_key.port[1] = s->key[idx]->port[0]; } - pf_unlink_state(s); + pf_remove_state(s); killed++; if (psk->psk_kill_match) @@ -5963,7 +5963,7 @@ relock: s->timeout = PFTM_PURGE; /* Don't send out individual delete messages. */ s->state_flags |= PFSTATE_NOSYNC; - pf_unlink_state(s); + pf_remove_state(s); goto relock; } PF_HASHROW_UNLOCK(ih); @@ -6121,7 +6121,7 @@ relock_DIOCCLRSTATES: * delete messages. */ s->state_flags |= PFSTATE_NOSYNC; - pf_unlink_state(s); + pf_remove_state(s); killed++; if (kill->psk_kill_match) @@ -6150,7 +6150,7 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) kill->psk_pfcmp.creatorid = V_pf_status.hostid; if ((s = pf_find_state_byid(kill->psk_pfcmp.id, kill->psk_pfcmp.creatorid))) { - pf_unlink_state(s); + pf_remove_state(s); *killed = 1; } return;