secchan: Avoid sending NetFlow packets for empty flows.
authorBen Pfaff <blp@nicira.com>
Fri, 28 Aug 2009 21:59:42 +0000 (14:59 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Aug 2009 21:59:42 +0000 (14:59 -0700)
There is no value in sending out NetFlow messages when the byte counter
(hence, packet counter) is 0.  This does not often happen, but it can in
corner cases where a flow gets installed but never sees any traffic before
it is uninstalled.

CC: Peter Balland <peter@nicira.com>
secchan/ofproto.c

index efa5c9b9e6d70e0f40c8c1f39455b7f1552374ff..b3fef1b71427874c1dadc1d46a56f1c244a0e7ab 100644 (file)
@@ -1696,7 +1696,7 @@ rule_post_uninstall(struct ofproto *ofproto, struct rule *rule)
     struct rule *super = rule->super;
 
     rule_account(ofproto, rule, 0);
-    if (ofproto->netflow) {
+    if (ofproto->netflow && rule->byte_count) {
         struct ofexpired expired;
         expired.flow = rule->cr.flow;
         expired.packet_count = rule->packet_count;