diff --git a/src/rust/lqosd/src/throughput_tracker/flow_data/netflow9/protocol/header.rs b/src/rust/lqosd/src/throughput_tracker/flow_data/netflow9/protocol/header.rs index fec54c27..2dc8dc5f 100644 --- a/src/rust/lqosd/src/throughput_tracker/flow_data/netflow9/protocol/header.rs +++ b/src/rust/lqosd/src/throughput_tracker/flow_data/netflow9/protocol/header.rs @@ -1,4 +1,4 @@ -use lqos_utils::unix_time::time_since_boot; +use lqos_utils::unix_time::{time_since_boot, unix_now}; use nix::sys::time::TimeValLike; #[repr(C)] @@ -15,12 +15,13 @@ impl Netflow9Header { /// Create a new Netflow 9 header pub(crate) fn new(flow_sequence: u32, record_count_including_templates: u16) -> Self { let uptime = time_since_boot().unwrap(); + let unix_secs = unix_now().unwrap_or(0); Self { version: (9u16).to_be(), count: record_count_including_templates.to_be(), sys_uptime: (uptime.num_milliseconds() as u32).to_be(), - unix_secs: (uptime.num_seconds() as u32).to_be(), + unix_secs: (unix_secs as u32).to_be(), package_sequence: flow_sequence.to_be(), source_id: 0, }