From: Ben Pfaff Date: Fri, 28 Aug 2009 21:59:42 +0000 (-0700) Subject: secchan: Avoid sending NetFlow packets for empty flows. X-Git-Tag: v0.90.5~19 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b6f67919d48078d2171927b291d0a2ac629c4535;p=sliver-openvswitch.git secchan: Avoid sending NetFlow packets for empty flows. 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 --- diff --git a/secchan/ofproto.c b/secchan/ofproto.c index efa5c9b9e..b3fef1b71 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -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;