[ovs-dev] [cleanups 01/13] ofproto: Fix used time of revalidated subrules.

Ben Pfaff blp at nicira.com
Fri Oct 29 23:37:50 UTC 2010


Despite the comment, the 'used' member of a rule is always set to at least
the value of 'created', except in one case in revalidation.  That case
appears to be just a mistake, so this commit changes it and corrects the
comment.
---
 ofproto/ofproto.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 2d77da5..0f9973d 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -88,7 +88,7 @@ struct rule {
     uint16_t idle_timeout;      /* In seconds from time of last use. */
     uint16_t hard_timeout;      /* In seconds from time of creation. */
     bool send_flow_removed;     /* Send a flow removed message? */
-    long long int used;         /* Last-used time (0 if never used). */
+    long long int used;         /* Last-used time (but >= 'created'). */
     long long int created;      /* Creation time. */
     uint64_t packet_count;      /* Number of packets received. */
     uint64_t byte_count;        /* Number of bytes received. */
@@ -4828,8 +4828,7 @@ revalidate_rule(struct ofproto *p, struct rule *rule)
             rule->super = super;
             rule->hard_timeout = super->hard_timeout;
             rule->idle_timeout = super->idle_timeout;
-            rule->created = super->created;
-            rule->used = 0;
+            rule->created = rule->used = super->created;
         }
     }
 
-- 
1.7.1





More information about the dev mailing list