summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2013-06-01 21:18:02 +0000
committerhenning <henning@openbsd.org>2013-06-01 21:18:02 +0000
commit1bafeeb25a44e47caab67e9d12aad425abdef6f4 (patch)
tree449fdd9902156db29f8604fb570d7aac6afd1296
parentuse the standardized names instead of S_IREAD and S_IWRITE (diff)
downloadwireguard-openbsd-1bafeeb25a44e47caab67e9d12aad425abdef6f4.tar.xz
wireguard-openbsd-1bafeeb25a44e47caab67e9d12aad425abdef6f4.zip
pf_step_{into,out_of}_anchor() are only ever called from pf_test_rule()
these days, so: -move the prototypes from pfvar.h to pf.c -remove the now useless null point checks for *match, it is always provided ok ryan
-rw-r--r--sys/net/pf.c15
-rw-r--r--sys/net/pfvar.h8
2 files changed, 10 insertions, 13 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index f239a8e2eb1..30cb2553590 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.825 2013/05/14 23:59:26 mikeb Exp $ */
+/* $OpenBSD: pf.c,v 1.826 2013/06/01 21:18:02 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -233,6 +233,11 @@ struct pf_state *pf_find_state(struct pfi_kif *,
int pf_src_connlimit(struct pf_state **);
int pf_check_congestion(struct ifqueue *);
int pf_match_rcvif(struct mbuf *, struct pf_rule *);
+void pf_step_into_anchor(int *, struct pf_ruleset **,
+ struct pf_rule **, struct pf_rule **, int *);
+int pf_step_out_of_anchor(int *, struct pf_ruleset **,
+ struct pf_rule **, struct pf_rule **,
+ int *);
void pf_counters_inc(int, struct pf_pdesc *,
struct pf_state *, struct pf_rule *,
struct pf_rule *);
@@ -2865,8 +2870,7 @@ pf_step_into_anchor(int *depth, struct pf_ruleset **rs,
struct pf_anchor_stackframe *f;
(*r)->anchor->match = 0;
- if (match)
- *match = 0;
+ *match = 0;
if (*depth >= sizeof(pf_anchor_stack) /
sizeof(pf_anchor_stack[0])) {
log(LOG_ERR, "pf_step_into_anchor: stack overflow\n");
@@ -2905,8 +2909,7 @@ pf_step_out_of_anchor(int *depth, struct pf_ruleset **rs,
break;
f = pf_anchor_stack + *depth - 1;
if (f->parent != NULL && f->child != NULL) {
- if (f->child->match ||
- (match != NULL && *match)) {
+ if (f->child->match || *match) {
f->r->anchor->match = 1;
*match = 0;
}
@@ -2924,7 +2927,7 @@ pf_step_out_of_anchor(int *depth, struct pf_ruleset **rs,
if (*depth == 0 && a != NULL)
*a = NULL;
*rs = f->rs;
- if (f->r->anchor->match || (match != NULL && *match))
+ if (f->r->anchor->match || *match)
quick = f->r->quick;
*r = TAILQ_NEXT(f->r, entries);
} while (*r == NULL);
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 6d255b47a10..25be4b3b2c0 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.379 2013/05/10 11:36:24 mikeb Exp $ */
+/* $OpenBSD: pfvar.h,v 1.380 2013/06/01 21:18:02 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1970,12 +1970,6 @@ struct pf_os_fingerprint *
#ifdef _KERNEL
void pf_print_host(struct pf_addr *, u_int16_t, u_int8_t);
-void pf_step_into_anchor(int *, struct pf_ruleset **,
- struct pf_rule **, struct pf_rule **, int *);
-int pf_step_out_of_anchor(int *, struct pf_ruleset **,
- struct pf_rule **, struct pf_rule **,
- int *);
-
int pf_get_transaddr(struct pf_rule *, struct pf_pdesc *,
struct pf_src_node **, struct pf_rule **);