summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorCedric Berger <cedric@cvs.openbsd.org>2003-02-27 12:56:06 +0000
committerCedric Berger <cedric@cvs.openbsd.org>2003-02-27 12:56:06 +0000
commit84e11a7a5ff6aa6d6440b608b3a6bce0271c8299 (patch)
treec93996995065e75acc3c79b138a75066fb6492a2 /sys
parentf36e6664ef5b0b95c9d20b486bdaa90d50793a2f (diff)
Repair IPv6 support for tables.
ok dhartmei@ henning@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c13
-rw-r--r--sys/net/pf_table.c6
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index fc7f829c22d..d912096ebd8 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.322 2003/02/25 17:54:06 mcbride Exp $ */
+/* $OpenBSD: pf.c,v 1.323 2003/02/27 12:56:04 cedric Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -4605,6 +4605,17 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0)
}
done:
+ if (r != NULL && r->src.addr.type == PF_ADDR_TABLE)
+ pfr_update_stats(r->src.addr.p.tbl,
+ (r->direction == dir) ? pd.src : pd.dst, pd.af,
+ pd.tot_len, dir == PF_OUT, r->action == PF_PASS,
+ r->src.not);
+ if (r != NULL && r->dst.addr.type == PF_ADDR_TABLE)
+ pfr_update_stats(r->dst.addr.p.tbl,
+ (r->direction == dir) ? pd.dst : pd.src, pd.af,
+ pd.tot_len, dir == PF_OUT, r->action == PF_PASS,
+ r->dst.not);
+
/* XXX handle IPv6 options, if not allowed. not implemented. */
if (log) {
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c
index 055605e8472..e500261d7d9 100644
--- a/sys/net/pf_table.c
+++ b/sys/net/pf_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_table.c,v 1.25 2003/02/12 20:10:08 henric Exp $ */
+/* $OpenBSD: pf_table.c,v 1.26 2003/02/27 12:56:05 cedric Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -1618,7 +1618,7 @@ pfr_match_addr(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af)
ke = (struct pfr_kentry *)rn_match(&pfr_sin, kt->pfrkt_ip4);
break;
case AF_INET6:
- bcopy(&a, &pfr_sin6.sin6_addr, sizeof(pfr_sin6.sin6_addr));
+ bcopy(a, &pfr_sin6.sin6_addr, sizeof(pfr_sin6.sin6_addr));
ke = (struct pfr_kentry *)rn_match(&pfr_sin6, kt->pfrkt_ip6);
break;
}
@@ -1642,7 +1642,7 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr *a, sa_family_t af,
ke = (struct pfr_kentry *)rn_match(&pfr_sin, kt->pfrkt_ip4);
break;
case AF_INET6:
- bcopy(&a, &pfr_sin6.sin6_addr, sizeof(pfr_sin6.sin6_addr));
+ bcopy(a, &pfr_sin6.sin6_addr, sizeof(pfr_sin6.sin6_addr));
ke = (struct pfr_kentry *)rn_match(&pfr_sin6, kt->pfrkt_ip6);
break;
}