diff options
| author | 2007-12-20 20:07:41 +0000 | |
|---|---|---|
| committer | 2007-12-20 20:07:41 +0000 | |
| commit | 32fcaf6f7341e572a65888d2a8f3ecbe68c65d1d (patch) | |
| tree | e85b829101c2d63291b0caee7f7aa634f0ba20d0 /sys/net/pf_table.c | |
| parent | Remove an obsolete nfs kludge, spotted by Frank Denis (many thanks), also there in NetBSD and FreeBSD trees. (diff) | |
| download | wireguard-openbsd-32fcaf6f7341e572a65888d2a8f3ecbe68c65d1d.tar.xz wireguard-openbsd-32fcaf6f7341e572a65888d2a8f3ecbe68c65d1d.zip | |
increment the match/nomatch table counters when using a table/pool in
rdr rules. this helps to get some statistics about l3 redirections.
ok henning@
Diffstat (limited to 'sys/net/pf_table.c')
| -rw-r--r-- | sys/net/pf_table.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index 8be75b2d835..eebe03bcb7e 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.71 2007/09/01 18:49:27 henning Exp $ */ +/* $OpenBSD: pf_table.c,v 1.72 2007/12/20 20:07:41 reyk Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -2122,8 +2122,10 @@ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, _next_block: ke = pfr_kentry_byidx(kt, idx, af); - if (ke == NULL) + if (ke == NULL) { + kt->pfrkt_nomatch++; return (1); + } pfr_prepare_network(&pfr_mask, af, ke->pfrke_net); *raddr = SUNION2PF(&ke->pfrke_sa, af); *rmask = SUNION2PF(&pfr_mask, af); @@ -2146,6 +2148,7 @@ _next_block: /* this is a single IP address - no possible nested block */ PF_ACPY(counter, addr, af); *pidx = idx; + kt->pfrkt_match++; return (0); } for (;;) { @@ -2161,6 +2164,7 @@ _next_block: /* lookup return the same block - perfect */ PF_ACPY(counter, addr, af); *pidx = idx; + kt->pfrkt_match++; return (0); } |
