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 <bluhm@openbsd.org>, acb93c8a64
Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
+1
-1
@@ -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 *,
|
||||
|
||||
@@ -1051,7 +1051,7 @@ pfsync_in_clr(struct mbuf *m, int offset, int count, int flags, int action)
|
||||
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);
|
||||
|
||||
+7
-7
@@ -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 @@ pf_purge_expired_states(u_int i, int maxcheck)
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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 @@ pf_killstates_row(struct pf_kstate_kill *psk, struct pf_idhash *ih)
|
||||
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 @@ pf_clear_all_states(void)
|
||||
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 @@ pf_clear_states(const struct pf_kstate_kill *kill)
|
||||
* 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;
|
||||
|
||||
Reference in New Issue
Block a user