From 26bd42a71c249575837021d5d8a6ae4c5bfa57b6 Mon Sep 17 00:00:00 2001 From: Alfredo Cardigliano Date: Tue, 23 May 2017 18:02:53 +0200 Subject: crc32 fix --- example/ndpiReader.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'example/ndpiReader.c') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index a1fa6f318..6aed8ec88 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1788,7 +1788,6 @@ static pcap_t * openPcapFileOrDevice(u_int16_t thread_id, const u_char * pcap_fi return pcap_handle; } - /** * @brief Check pcap packet */ @@ -1868,9 +1867,9 @@ static void pcap_process_packet(u_char *args, trailer->master_protocol = htons(p.master_protocol), trailer->app_protocol = htons(p.app_protocol); ndpi_protocol2name(ndpi_thread_info[thread_id].workflow->ndpi_struct, p, trailer->name, sizeof(trailer->name)); crc = (uint32_t*)&extcap_buf[h.caplen+sizeof(struct ndpi_packet_trailer)]; - *crc = 0; - ethernet_crc32((const void*)extcap_buf, h.caplen+sizeof(struct ndpi_packet_trailer), crc); - h.caplen += delta, h.len += delta; + *crc = ethernet_crc32((const void*)extcap_buf, h.caplen+sizeof(struct ndpi_packet_trailer)); + h.caplen += delta; + h.len += delta; #ifdef DEBUG_TRACE if(trace) fprintf(trace, "Dumping %u bytes packet\n", h.caplen); -- cgit v1.2.3