@@ -70,9 +70,9 @@ static bool process_netflow_v1(NFSample *sample)
7070 return false ;
7171 }
7272
73- sample->uptime_ms = nf1_hdr->uptime_ms ;
74- sample->time_sec = nf1_hdr->time_sec ;
75- sample->time_nanosec = nf1_hdr->time_nanosec ;
73+ sample->uptime_ms = be32toh ( nf1_hdr->uptime_ms ) ;
74+ sample->time_sec = be32toh ( nf1_hdr->time_sec ) ;
75+ sample->time_nanosec = be32toh ( nf1_hdr->time_nanosec ) ;
7676
7777 for (uint16_t flow = 0 ; flow < sample->nflows ; flow++) {
7878 offset = NF1_PACKET_SIZE (flow);
@@ -118,10 +118,10 @@ static bool process_netflow_v5(NFSample *sample)
118118 return false ;
119119 }
120120
121- sample->uptime_ms = nf5_hdr->uptime_ms ;
122- sample->time_sec = nf5_hdr->time_sec ;
123- sample->time_nanosec = nf5_hdr->time_nanosec ;
124- sample->flow_sequence = nf5_hdr->flow_sequence ;
121+ sample->uptime_ms = be32toh ( nf5_hdr->uptime_ms ) ;
122+ sample->time_sec = be32toh ( nf5_hdr->time_sec ) ;
123+ sample->time_nanosec = be32toh ( nf5_hdr->time_nanosec ) ;
124+ sample->flow_sequence = be32toh ( nf5_hdr->flow_sequence ) ;
125125
126126 for (uint16_t flow = 0 ; flow < sample->nflows ; flow++) {
127127 offset = NF5_PACKET_SIZE (flow);
@@ -172,10 +172,10 @@ static bool process_netflow_v7(NFSample *sample)
172172 return false ;
173173 }
174174
175- sample->uptime_ms = nf7_hdr->uptime_ms ;
176- sample->time_sec = nf7_hdr->time_sec ;
177- sample->time_nanosec = nf7_hdr->time_nanosec ;
178- sample->flow_sequence = nf7_hdr->flow_sequence ;
175+ sample->uptime_ms = be32toh ( nf7_hdr->uptime_ms ) ;
176+ sample->time_sec = be32toh ( nf7_hdr->time_sec ) ;
177+ sample->time_nanosec = be32toh ( nf7_hdr->time_nanosec ) ;
178+ sample->flow_sequence = be32toh ( nf7_hdr->flow_sequence ) ;
179179
180180 for (uint16_t flow = 0 ; flow < sample->nflows ; flow++) {
181181 offset = NF7_PACKET_SIZE (flow);
@@ -395,8 +395,8 @@ static bool process_netflow_v9(NFSample *sample)
395395 uint32_t i, flowset_id, flowset_len, flowset_flows;
396396 uint32_t offset, total_flows;
397397
398- sample->uptime_ms = nf9_hdr->uptime_ms ;
399- sample->time_sec = nf9_hdr->time_sec ;
398+ sample->uptime_ms = be32toh ( nf9_hdr->uptime_ms ) ;
399+ sample->time_sec = be32toh ( nf9_hdr->time_sec ) ;
400400 sample->flow_sequence = be32toh (nf9_hdr->package_sequence );
401401 sample->source_id = be32toh (nf9_hdr->source_id );
402402
@@ -618,7 +618,7 @@ static bool process_netflow_v10(NFSample *sample)
618618 uint32_t i, flowset_id, flowset_len, flowset_flows;
619619 uint32_t offset, total_flows;
620620
621- sample->time_sec = nf10_hdr->time_sec ;
621+ sample->time_sec = be32toh ( nf10_hdr->time_sec ) ;
622622 sample->flow_sequence = be32toh (nf10_hdr->package_sequence );
623623 sample->source_id = be32toh (nf10_hdr->source_id );
624624
0 commit comments