From 0b5d6dddecebd8966e0ac126200e40afabb1c67b Mon Sep 17 00:00:00 2001 From: Todd Johnson Date: Thu, 10 Jan 2019 14:12:44 -0500 Subject: [PATCH 1/3] Fix for unsued variable and incrementing bool --- src/fp.c | 10 +++++----- src/pkt_proc.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fp.c b/src/fp.c index 513a89cc..ff2e7d47 100644 --- a/src/fp.c +++ b/src/fp.c @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2018 Cisco Systems, Inc. + * Copyright (c) 2018-2019 Cisco Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,10 +95,10 @@ void fpx_init(struct fpx **fpx_handle) { * \return none */ void fpx_update (struct fpx *fpx, - const struct pcap_pkthdr *header, - const void *data, - unsigned int len, - unsigned int report_fpx) { + const struct pcap_pkthdr *header __attribute__((unused)), + const void *data, + unsigned int len, + unsigned int report_fpx) { struct extractor x; if (report_fpx && fpx) { diff --git a/src/pkt_proc.c b/src/pkt_proc.c index 023bae34..931801e3 100644 --- a/src/pkt_proc.c +++ b/src/pkt_proc.c @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2016-2018 Cisco Systems, Inc. + * Copyright (c) 2016-2019 Cisco Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1112,7 +1112,7 @@ void* process_packet (unsigned char *ctx_ptr, } return NULL; } - record->invalid++; + record->invalid = 1; } /* From e9cc38ca6b6490bbe9be579c09be2aebb9a4209a Mon Sep 17 00:00:00 2001 From: Todd Johnson Date: Thu, 10 Jan 2019 14:31:56 -0500 Subject: [PATCH 2/3] A better fix --- src/fp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fp.c b/src/fp.c index ff2e7d47..2da47bf5 100644 --- a/src/fp.c +++ b/src/fp.c @@ -95,13 +95,13 @@ void fpx_init(struct fpx **fpx_handle) { * \return none */ void fpx_update (struct fpx *fpx, - const struct pcap_pkthdr *header __attribute__((unused)), + const struct pcap_pkthdr *header, const void *data, unsigned int len, unsigned int report_fpx) { struct extractor x; - if (report_fpx && fpx) { + if (report_fpx && fpx && header) { if (fpx->tcp_fp_len == 0) { extractor_init(&x, data, len, fpx->tcp_fp, MAX_TCP_FP_LEN); From db9bf19a1785b64e63c24510107319f61552c6ef Mon Sep 17 00:00:00 2001 From: Stephen Magill Date: Tue, 16 Jul 2019 10:47:00 -0400 Subject: [PATCH 3/3] Update src/fp.c --- src/fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fp.c b/src/fp.c index 2da47bf5..16208661 100644 --- a/src/fp.c +++ b/src/fp.c @@ -101,7 +101,7 @@ void fpx_update (struct fpx *fpx, unsigned int report_fpx) { struct extractor x; - if (report_fpx && fpx && header) { + if (report_fpx && fpx) { if (fpx->tcp_fp_len == 0) { extractor_init(&x, data, len, fpx->tcp_fp, MAX_TCP_FP_LEN);