diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-07 19:54:53 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-07 19:54:53 +0200 |
commit | 4f245b484aa903b545768532edbdc3efffb949c2 (patch) | |
tree | a35f006b42e740ef3c2e7d520470256616a324cf /main.c | |
parent | 04cbb9c53929173ff0ae261c0bb22b5928ffc23b (diff) |
main: account dropped packets
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
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; } |