summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Berger <cedric@cvs.openbsd.org>2003-06-08 10:32:36 +0000
committerCedric Berger <cedric@cvs.openbsd.org>2003-06-08 10:32:36 +0000
commit214f38f202749acacd3b5fe005c4f10c416804db (patch)
treecb651cd4e56efc27cbe23c2896fcc22aae04cc37
parent7b563ed48a78c7df6b888d4a74d30fa1a6592c8d (diff)
Returns the correct array size.
-rw-r--r--sys/net/pf_table.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c
index 68294aafff5..44525f1aa4a 100644
--- a/sys/net/pf_table.c
+++ b/sys/net/pf_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_table.c,v 1.36 2003/06/08 09:41:08 cedric Exp $ */
+/* $OpenBSD: pf_table.c,v 1.37 2003/06/08 10:32:35 cedric Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -1148,10 +1148,10 @@ pfr_get_tables(struct pfr_table *filter, struct pfr_table *tbl, int *size,
int flags)
{
struct pfr_ktable *p;
- int n;
+ int n, nn;
ACCEPT_FLAGS(PFR_FLAG_ALLRSETS);
- n = pfr_table_count(filter, flags);
+ n = nn = pfr_table_count(filter, flags);
if (n < 0)
return (ENOENT);
if (n > *size) {
@@ -1170,7 +1170,7 @@ pfr_get_tables(struct pfr_table *filter, struct pfr_table *tbl, int *size,
printf("pfr_get_tables: corruption detected (%d).\n", n);
return (ENOTTY);
}
- *size = pfr_ktable_cnt;
+ *size = nn;
return (0);
}
@@ -1180,12 +1180,12 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_tstats *tbl, int *size,
{
struct pfr_ktable *p;
struct pfr_ktableworkq workq;
- int s, n;
+ int s, n, nn;
long tzero = time.tv_sec;
ACCEPT_FLAGS(PFR_FLAG_ATOMIC|PFR_FLAG_ALLRSETS);
/* XXX PFR_FLAG_CLSTATS disabled */
- n = pfr_table_count(filter, flags);
+ n = nn = pfr_table_count(filter, flags);
if (n < 0)
return (ENOENT);
if (n > *size) {
@@ -1219,7 +1219,7 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_tstats *tbl, int *size,
printf("pfr_get_tstats: corruption detected (%d).\n", n);
return (ENOTTY);
}
- *size = pfr_ktable_cnt;
+ *size = nn;
return (0);
}