summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/netflow/netflow_v9.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netgraph/netflow/netflow_v9.c')
-rw-r--r--sys/netgraph/netflow/netflow_v9.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netgraph/netflow/netflow_v9.c b/sys/netgraph/netflow/netflow_v9.c
index e10157c..b918feb 100644
--- a/sys/netgraph/netflow/netflow_v9.c
+++ b/sys/netgraph/netflow/netflow_v9.c
@@ -416,16 +416,14 @@ get_export9_dgram(priv_p priv, fib_export_p fe, struct netflow_v9_packet_opt **t
* Check if we need to insert templates into packet
*/
- struct timespec ts;
struct netflow_v9_flowset_header *fl;
- getnanotime(&ts);
- if ((ts.tv_sec >= priv->templ_time + fe->templ_last_ts) ||
+ if ((time_uptime >= priv->templ_time + fe->templ_last_ts) ||
(fe->sent_packets >= priv->templ_packets + fe->templ_last_pkt)) {
- atomic_store_rel_32(&fe->templ_last_ts, ts.tv_sec);
- atomic_store_rel_32(&fe->templ_last_pkt, fe->sent_packets);
-
+ fe->templ_last_ts = time_uptime;
+ fe->templ_last_pkt = fe->sent_packets;
+
fl = priv->v9_flowsets[0];
m_append(m, ntohs(fl->length), (void *)fl);
t->flow_header = m->m_len;
OpenPOWER on IntegriCloud