svn commit: r237164 - head/sys/netgraph/netflow

Alexander V. Chernikov melifaro at FreeBSD.org
Sat Jun 16 13:55:32 UTC 2012


Author: melifaro
Date: Sat Jun 16 13:55:31 2012
New Revision: 237164
URL: http://svn.freebsd.org/changeset/base/237164

Log:
  Use time_uptime instead of getnanotime for accouting integer number of seconds.
  
  Reviewed by:     glebius
  Approved by:     ae(mentor)
  MFC after:       1 week

Modified:
  head/sys/netgraph/netflow/netflow_v9.c

Modified: head/sys/netgraph/netflow/netflow_v9.c
==============================================================================
--- head/sys/netgraph/netflow/netflow_v9.c	Sat Jun 16 13:53:14 2012	(r237163)
+++ head/sys/netgraph/netflow/netflow_v9.c	Sat Jun 16 13:55:31 2012	(r237164)
@@ -416,16 +416,14 @@ get_export9_dgram(priv_p priv, fib_expor
 		 * 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;


More information about the svn-src-all mailing list