diff options
author | Alfredo Cardigliano <cardigliano@ntop.org> | 2017-05-23 18:02:53 +0200 |
---|---|---|
committer | Alfredo Cardigliano <cardigliano@ntop.org> | 2017-05-23 18:02:53 +0200 |
commit | 26bd42a71c249575837021d5d8a6ae4c5bfa57b6 (patch) | |
tree | 68e7d4c121c7a198bb866cb3fe2f3caad1e0ea1e /example/ndpiReader.c | |
parent | 601f7f59ff2ae016970a796c6314f55423ed7fe9 (diff) |
crc32 fix
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 7 |
1 files changed, 3 insertions, 4 deletions
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); |