summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2004-05-18 10:35:23 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2004-05-18 10:35:23 +0000
commita174387f1484dd95a23635469066fe0a046f5d95 (patch)
tree56f6ceb4d6e6cc9b6b19d5a18ec3504f70b9bd32 /sys
parent6f276ce8e97c62d49b53f56fd8ccd3e6c0202c57 (diff)
In DIOCCHANGERULE, move ticket increment above code that might free
the ruleset and invalidate the pointer. ok cedric@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf_ioctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index 56f7c2cd6ec..721c3219a9d 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.119 2004/05/05 23:16:03 frantzen Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.120 2004/05/18 10:35:22 dhartmei Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1388,10 +1388,11 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
ruleset->rules[rs_num].active.ptr, entries)
oldrule->nr = nr++;
+ ruleset->rules[rs_num].active.ticket++;
+
pf_calc_skip_steps(ruleset->rules[rs_num].active.ptr);
pf_remove_if_empty_ruleset(ruleset);
- ruleset->rules[rs_num].active.ticket++;
splx(s);
break;
}