diff options
author | 2003-08-28 09:41:03 +0000 | |
---|---|---|
committer | 2003-08-28 09:41:03 +0000 | |
commit | 6542ad0f263e66f0ae4d5697d83eb80623487c49 (patch) | |
tree | ad7fa6461f27dd4109dd75a7135098aa247397d9 | |
parent | don't like libgss/krb5 twice, fixes non-KERBEROS builds; pmbas@samhaim.org (diff) | |
download | wireguard-openbsd-6542ad0f263e66f0ae4d5697d83eb80623487c49.tar.xz wireguard-openbsd-6542ad0f263e66f0ae4d5697d83eb80623487c49.zip |
fix "pfctl -vvsr" output for rules with tables inside anchors.
ok henning@
-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 |