summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.c b/main.c
index fcffbad..7f8221d 100755
--- a/main.c
+++ b/main.c
@@ -13,6 +13,7 @@
#include "include/helper.h"
#include "test.h"
+#include <linux/netfilter.h>
#include <libnetfilter_queue/pktbuff.h>
struct cthelper_test_stats cthelper_test_stats;
@@ -132,6 +133,9 @@ cthelper_process_packet(const uint8_t *pkt, uint32_t pktlen,
} else
ret = h->cb(pktb, dataoff, ct->myct, ctinfo);
+ if (ret == NF_DROP)
+ cthelper_test_stats.pkts_dropped++;
+
pktb_free(pktb);
return ret;
@@ -211,11 +215,12 @@ int main(int argc, char *argv[])
ret = EXIT_SUCCESS;
printf("\e[1;34mTest results: expect_created=%d packets=%d "
- "packets_skipped=%d\e[0m\n",
+ "packets_skipped=%d packets_dropped=%d\e[0m\n",
cthelper_test_stats.ct_expect_created,
cthelper_test_stats.pkts,
cthelper_test_stats.pkt_mismatch_proto +
- cthelper_test_stats.pkt_mismatch_port);
+ cthelper_test_stats.pkt_mismatch_port,
+ cthelper_test_stats.pkts_dropped);
return ret;
}