diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2003-04-03 13:17:25 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2003-04-03 13:17:25 +0000 |
commit | 42a1c5b3e569b9a1279e515df784416243eaaa05 (patch) | |
tree | 28c098da9b1dd1e01dc23ed20ea4fdae6029b111 /sys/net | |
parent | a8438631d0c834d48a9f34d2946de6229910c9a5 (diff) |
Remove (state->rule.ptr != NULL) tests: this is always true now.
ok dhartmei@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 26 | ||||
-rw-r--r-- | sys/net/pf_ioctl.c | 6 |
2 files changed, 12 insertions, 20 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 6db652ac3a4..7aa810c56d1 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.329 2003/03/31 13:15:27 cedric Exp $ */ +/* $OpenBSD: pf.c,v 1.330 2003/04/03 13:17:24 cedric Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -253,7 +253,6 @@ struct pf_pool_limit pf_pool_limits[PF_LIMIT_MAX] = if (*state == NULL) \ return (PF_DROP); \ if (direction == PF_OUT && \ - (*state)->rule.ptr != NULL && \ (((*state)->rule.ptr->rt == PF_ROUTETO && \ (*state)->rule.ptr->direction == PF_OUT) || \ ((*state)->rule.ptr->rt == PF_REPLYTO && \ @@ -504,9 +503,8 @@ pf_purge_expired_states(void) #if NPFSYNC pfsync_delete_state(cur->state); #endif - if (cur->state->rule.ptr != NULL) - if (--cur->state->rule.ptr->states <= 0) - pf_rm_rule(NULL, cur->state->rule.ptr); + if (--cur->state->rule.ptr->states <= 0) + pf_rm_rule(NULL, cur->state->rule.ptr); if (cur->state->nat_rule != NULL) if (--cur->state->nat_rule->states <= 0) pf_rm_rule(NULL, cur->state->nat_rule); @@ -3149,10 +3147,8 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct ifnet *ifp, m_copyback(m, off, sizeof(*th), (caddr_t)th); } - if ((*state)->rule.ptr != NULL) { - (*state)->rule.ptr->packets++; - (*state)->rule.ptr->bytes += pd->tot_len; - } + (*state)->rule.ptr->packets++; + (*state)->rule.ptr->bytes += pd->tot_len; if ((*state)->nat_rule != NULL) { (*state)->nat_rule->packets++; (*state)->nat_rule->bytes += pd->tot_len; @@ -3215,10 +3211,8 @@ pf_test_state_udp(struct pf_state **state, int direction, struct ifnet *ifp, m_copyback(m, off, sizeof(*uh), (caddr_t)uh); } - if ((*state)->rule.ptr != NULL) { - (*state)->rule.ptr->packets++; - (*state)->rule.ptr->bytes += pd->tot_len; - } + (*state)->rule.ptr->packets++; + (*state)->rule.ptr->bytes += pd->tot_len; if ((*state)->nat_rule != NULL) { (*state)->nat_rule->packets++; (*state)->nat_rule->bytes += pd->tot_len; @@ -3771,10 +3765,8 @@ pf_test_state_other(struct pf_state **state, int direction, struct ifnet *ifp, } } - if ((*state)->rule.ptr != NULL) { - (*state)->rule.ptr->packets++; - (*state)->rule.ptr->bytes += pd->tot_len; - } + (*state)->rule.ptr->packets++; + (*state)->rule.ptr->bytes += pd->tot_len; if ((*state)->nat_rule != NULL) { (*state)->nat_rule->packets++; (*state)->nat_rule->bytes += pd->tot_len; diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index fc41e5a7bd8..8fb5955c979 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.51 2003/03/31 13:15:27 cedric Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.52 2003/04/03 13:17:24 cedric Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -963,7 +963,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) break; } bcopy(n->state, &ps->state, sizeof(struct pf_state)); - if (n->state->rule.ptr == NULL) + if (n->state->rule.ptr->entries.tqe_prev == NULL) ps->state.rule.nr = -1; else ps->state.rule.nr = n->state->rule.ptr->nr; @@ -1002,7 +1002,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) break; bcopy(n->state, &pstore, sizeof(pstore)); - if (n->state->rule.ptr == NULL) + if (n->state->rule.ptr->entries.tqe_prev == NULL) pstore.rule.nr = -1; else pstore.rule.nr = n->state->rule.ptr->nr; |