diff options
-rw-r--r-- | sbin/pfctl/pfctl.c | 3 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 3 | ||||
-rw-r--r-- | sys/net/pf.c | 6 | ||||
-rw-r--r-- | sys/net/pfvar.h | 3 |
4 files changed, 9 insertions, 6 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 7f1d36de575..da2eb7cd3e6 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.13 2001/06/26 17:46:02 deraadt Exp $ */ +/* $OpenBSD: pfctl.c,v 1.14 2001/06/26 20:50:26 dhartmei Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -199,7 +199,6 @@ pfctl_show_rules(int dev) errx(1, "DIOCGETRULE"); return (1); } - printf("@%u ", nr + 1); print_rule(&pr.rule); } return (0); diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index c75c4657050..75fd701a321 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.13 2001/06/26 19:43:15 dhartmei Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.14 2001/06/26 20:50:26 dhartmei Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -387,6 +387,7 @@ print_state(struct pf_state *s) void print_rule(struct pf_rule *r) { + printf("@%d ", r->nr + 1); if (r->action == 0) printf("pass "); else 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 { |