[ovs-dev] [PATCH] netflow: Increase maximum number of NetFlow records to 30.

Jesse Gross jesse at nicira.com
Mon Oct 5 20:31:21 UTC 2009


NetFlow v5 allows up to 30 records per packet but we were incorrectly
limiting to 29.  This corrects that and also uses the count of the
number of records in the header rather than the packet size since
it is easier to reason about.

Bug #2103
---
 secchan/netflow.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/secchan/netflow.c b/secchan/netflow.c
index 7dd2e04..7912b4b 100644
--- a/secchan/netflow.c
+++ b/secchan/netflow.c
@@ -221,9 +221,8 @@ netflow_expire(struct netflow *nf, const struct ofexpired *expired)
     nf_rec->ip_proto = expired->flow.nw_proto;
     nf_rec->ip_tos = expired->ip_tos;
 
-    /* NetFlow messages are limited to 30 records.  A length of 1400
-     * bytes guarantees that the limit is not exceeded.  */
-    if (nf->packet.size >= 1400) {
+    /* NetFlow messages are limited to 30 records. */
+    if (ntohs(nf_hdr->count) >= 30) {
         netflow_run(nf);
     }
 }
-- 
1.6.0.4





More information about the dev mailing list