ofproto-dpif: Make sure one-packet flows have zero duration.
authorBen Pfaff <blp@nicira.com>
Mon, 13 Aug 2012 16:41:59 +0000 (09:41 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 16 Aug 2012 15:09:46 +0000 (08:09 -0700)
commit6a0a5bbbca747ef3b12bb6810cc5e16a5fd7068e
tree59c41fd61958114f04833a4d5164d6b341db7cc9
parent3b145dd7c001eb22f520b5ffd4179aaec59ebffe
ofproto-dpif: Make sure one-packet flows have zero duration.

A Nicira internal build recently failed the "ofproto-dpif - NetFlow flow
expiration" test because of the following difference in output:

     header: v5, seq 0, engine 2,1
    -rec: [...], 1 pkts, 60 bytes, ICMP 8:0, time <moment>
    +rec: [...], 1 pkts, 60 bytes, ICMP 8:0, time <range>

Looking at the actual output, it is:
    rec: 192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes,
    ICMP 8:0, time 8...9

That is, a one-packet flow was shown to have more than a momentary
duration, which doesn't make sense.

This commit fixes the problem by making sure that creating a facet and then
its initial subfacet only checks the current time once.

Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif.c