diff options
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 3a88c0aab..851203962 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -174,12 +174,13 @@ struct receiver *receivers = NULL, *topReceivers = NULL; #define WIRESHARK_NTOP_MAGIC 0x19680924 +PACK_ON struct ndpi_packet_trailer { u_int32_t magic; /* WIRESHARK_NTOP_MAGIC */ u_int16_t master_protocol /* e.g. HTTP */, app_protocol /* e.g. FaceBook */; ndpi_risk flow_risk; char name[16]; -}; +} PACK_OFF; static pcap_dumper_t *extcap_dumper = NULL; static pcap_t *extcap_fifo_h = NULL; @@ -3285,7 +3286,7 @@ static void ndpi_process_packet(u_char *args, memcpy(extcap_buf, packet, h.caplen); memset(trailer, 0, sizeof(struct ndpi_packet_trailer)); trailer->magic = htonl(WIRESHARK_NTOP_MAGIC); - trailer->flow_risk = htonl(flow_risk); + trailer->flow_risk = htonll(flow_risk); 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)]; |