diff options
Diffstat (limited to 'main.c')
-rwxr-xr-x | main.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; } |