summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDaniel Hartmeier <dhartmei@cvs.openbsd.org>2001-06-26 20:50:27 +0000
committerDaniel Hartmeier <dhartmei@cvs.openbsd.org>2001-06-26 20:50:27 +0000
commit51274230005eca07b5b85e55023d69dfd2e87369 (patch)
treecc8ede586333078c7f6ab5b87ac77a01ef78ecea /sys
parent8c58f9fa25b6159cec363288cb3f4de5d9547be7 (diff)
add rule nr for Niels
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c6
-rw-r--r--sys/net/pfvar.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index e3271384da1..9a84e88d951 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.60 2001/06/26 20:06:36 provos Exp $ */
+/* $OpenBSD: pf.c,v 1.61 2001/06/26 20:50:26 dhartmei Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -645,7 +645,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
case DIOCADDRULE: {
struct pfioc_rule *pr = (struct pfioc_rule *)addr;
- struct pf_rule *rule;
+ struct pf_rule *rule, *tail;
if (pr->ticket != ticket_rules_inactive) {
error = EBUSY;
@@ -657,6 +657,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
break;
}
bcopy(&pr->rule, rule, sizeof(struct pf_rule));
+ tail = TAILQ_LAST(pf_rules_inactive, pf_rulequeue);
+ rule->nr = tail ? tail->nr + 1 : 0;
rule->ifp = NULL;
if (rule->ifname[0]) {
rule->ifp = ifunit(rule->ifname);
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 5daa870ae7c..85af2009295 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.17 2001/06/26 19:43:14 dhartmei Exp $ */
+/* $OpenBSD: pfvar.h,v 1.18 2001/06/26 20:50:26 dhartmei Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -66,6 +66,7 @@ struct pf_rule {
u_int8_t flags;
u_int8_t flagset;
+ u_int16_t nr;
};
struct pf_state_host {