summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-11-23 00:47:57 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-11-23 00:47:57 +0000
commitc77c5a37b9f7607a16a880f936c638a50304b06d (patch)
tree0e543064bb02f6111b6729dadc9c74101c4abfb9 /usr.sbin
parent7a0215ca529952afb7cda8584a8a32eb729a38a8 (diff)
Make the tree compile again. Henning and I are both quite sure this is
correct.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/authpf/authpf.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/usr.sbin/authpf/authpf.c b/usr.sbin/authpf/authpf.c
index 8f8c42096f5..a549221152a 100644
--- a/usr.sbin/authpf/authpf.c
+++ b/usr.sbin/authpf/authpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authpf.c,v 1.112 2009/01/10 19:08:53 miod Exp $ */
+/* $OpenBSD: authpf.c,v 1.113 2009/11/23 00:47:56 claudio Exp $ */
/*
* Copyright (C) 1998 - 2007 Bob Beck (beck@openbsd.org).
@@ -668,24 +668,20 @@ recursive_ruleset_purge(char *an, char *rs)
struct pfioc_trans_e *t_e = NULL;
struct pfioc_trans *t = NULL;
struct pfioc_ruleset *prs = NULL;
- int i;
-
/* purge rules */
errno = 0;
if ((t = calloc(1, sizeof(struct pfioc_trans))) == NULL)
goto no_mem;
- if ((t_e = calloc(PF_RULESET_MAX+1,
- sizeof(struct pfioc_trans_e))) == NULL)
+ if ((t_e = calloc(2, sizeof(struct pfioc_trans_e))) == NULL)
goto no_mem;
- t->size = PF_RULESET_MAX+1;
+ t->size = 2;
t->esize = sizeof(struct pfioc_trans_e);
t->array = t_e;
- for (i = 0; i < PF_RULESET_MAX+1; ++i) {
- t_e[i].rs_num = i;
- snprintf(t_e[i].anchor, sizeof(t_e[i].anchor), "%s/%s", an, rs);
- }
- t_e[PF_RULESET_MAX].rs_num = PF_RULESET_TABLE;
+ t_e[0].type = PF_TRANS_RULESET;
+ snprintf(t_e[0].anchor, sizeof(t_e[0].anchor), "%s/%s", an, rs);
+ t_e[1].type = PF_TRANS_TABLE;
+
if ((ioctl(dev, DIOCXBEGIN, t) ||
ioctl(dev, DIOCXCOMMIT, t)) &&
errno != EINVAL)