diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2003-08-28 09:41:04 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2003-08-28 09:41:04 +0000 |
commit | e90dc94fe063411316b87844ba1304577d549571 (patch) | |
tree | 73b4450df35070286be20a27faf048fd54f4e773 /sys/net | |
parent | d02f5dd6a6ab0a40a59f1d1f9603c03a90984f9d (diff) |
fix "pfctl -vvsr" output for rules with tables inside anchors.
ok henning@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 593ed77af13..a1e690be286 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.386 2003/08/21 19:12:07 frantzen Exp $ */ +/* $OpenBSD: pf.c,v 1.387 2003/08/28 09:41:03 cedric Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -554,10 +554,15 @@ pf_tbladdr_remove(struct pf_addr_wrap *aw) void pf_tbladdr_copyout(struct pf_addr_wrap *aw) { - if (aw->type != PF_ADDR_TABLE || aw->p.tbl == NULL) + struct pfr_ktable *kt = aw->p.tbl; + + if (aw->type != PF_ADDR_TABLE || kt == NULL) return; - aw->p.tblcnt = (aw->p.tbl->pfrkt_flags & PFR_TFLAG_ACTIVE) ? - aw->p.tbl->pfrkt_cnt : -1; + if (!(kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && kt->pfrkt_root != NULL) + kt = kt->pfrkt_root; + aw->p.tbl = NULL; + aw->p.tblcnt = (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) ? + kt->pfrkt_cnt : -1; } int |