diff options
| author | 2012-01-26 11:30:39 +0000 | |
|---|---|---|
| committer | 2012-01-26 11:30:39 +0000 | |
| commit | dba347c9d1b9bec85aa234dbb21f2073f4be0ac6 (patch) | |
| tree | 7f8f035c4600a5587b81f4be96c80f400f32d698 /sys/net/pf_table.c | |
| parent | Make the default rate 48kHz and the default block size 10ms. These (diff) | |
| download | wireguard-openbsd-dba347c9d1b9bec85aa234dbb21f2073f4be0ac6.tar.xz wireguard-openbsd-dba347c9d1b9bec85aa234dbb21f2073f4be0ac6.zip | |
when table content changes we need to reset index
to the initial value and do not use the counter;
reported by Sebastian Benoit and Daniel Krambrock,
tested by Sebastian Benoit, ok henning zinke
Diffstat (limited to 'sys/net/pf_table.c')
| -rw-r--r-- | sys/net/pf_table.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index 17f7b786d43..3abf0d212a9 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.93 2011/07/27 00:26:10 mcbride Exp $ */ +/* $OpenBSD: pf_table.c,v 1.94 2012/01/26 11:30:39 mikeb Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -2198,10 +2198,10 @@ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, if (pidx != NULL) idx = *pidx; - if (counter != NULL && idx >= 0) - use_counter = 1; - if (idx < 0) + if (idx < 0 || idx >= kt->pfrkt_cnt) idx = 0; + else if (counter != NULL) + use_counter = 1; startidx = idx; _next_block: |
