From 0b2265da0d0dadfae5f0442700d6903ce3fe0bee Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 12 Mar 2012 12:53:26 +0100 Subject: qa: several improvements for the ct_stress tools This patch improves several aspects of the QA tools to stress the conntrack system via ctnetlink and to check reliable event delivery. Signed-off-by: Pablo Neira Ayuso --- qa/ct_stress.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qa/ct_stress.c') diff --git a/qa/ct_stress.c b/qa/ct_stress.c index 36aa1a0..328409c 100644 --- a/qa/ct_stress.c +++ b/qa/ct_stress.c @@ -19,7 +19,7 @@ int main(int argc, char *argv[]) { time_t t; - int ret, i, r; + int ret, i, j, r; struct nfct_handle *h; struct nf_conntrack *ct; @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) return -1; } - for (i = r;i < (r + atoi(argv[1]) * 2); i++) { + for (i = r, j = 0;i < (r + atoi(argv[1]) * 2); i++, j++) { nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET); nfct_set_attr_u32(ct, ATTR_IPV4_SRC, inet_addr("1.1.1.1") + i); nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr("2.2.2.2") + i); @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) nfct_set_attr_u32(ct, ATTR_STATUS, IPS_ASSURED); if (i % 10000 == 0) - printf("added %d flow entries\n", i); + printf("added %d flow entries\n", j); ret = nfct_query(h, NFCT_Q_CREATE, ct); if (ret == -1) -- cgit v1.2.3