diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-05 13:00:44 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-05 13:00:44 +0000 |
commit | c8a65b5092dcb05e1d1bb1241d24175a275c23c9 (patch) | |
tree | 00ae83b397db08aad21070b4c4a6ca3074e0eb1f /sys | |
parent | af78c8b4c47bb42ef61787f9c65989323d27ea17 (diff) |
remove a useless refcnt in pf_state_key.
when it is in fact only used to delete the state key when the number of
attached states (in a tailq) drops to zero, we can as well test for the
queue beeing empty.
this is a leftover from some early version that did things differently.
ok ryan
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/pf.c | 5 | ||||
-rw-r--r-- | sys/net/pfvar.h | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index b99b767f933..957320be3c3 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.567 2008/02/20 23:40:13 henning Exp $ */ +/* $OpenBSD: pf.c,v 1.568 2008/05/05 13:00:43 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -2836,7 +2836,6 @@ void pf_attach_state(struct pf_state_key *sk, struct pf_state *s, int tail) { s->state_key = sk; - sk->refcnt++; /* list is sorted, if-bound states before floating */ if (tail) @@ -2855,7 +2854,7 @@ pf_detach_state(struct pf_state *s, int flags) s->state_key = NULL; TAILQ_REMOVE(&sk->states, s, next); - if (--sk->refcnt == 0) { + if (TAILQ_EMPTY(&sk->states)) { if (!(flags & PF_DT_SKIP_EXTGWY)) RB_REMOVE(pf_state_tree_ext_gwy, &pf_statetbl_ext_gwy, sk); diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 7f2bf5e88ab..d063b4fdf63 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.259 2007/12/02 12:08:04 pascoe Exp $ */ +/* $OpenBSD: pfvar.h,v 1.260 2008/05/05 13:00:43 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -713,7 +713,6 @@ struct pf_state_key { RB_ENTRY(pf_state_key) entry_lan_ext; RB_ENTRY(pf_state_key) entry_ext_gwy; struct pf_statelist states; - u_short refcnt; /* same size as if_index */ }; |