[ovs-dev] [PATCH] ofproto: Update time of super-rule to match sub-rule

Justin Pettit jpettit at nicira.com
Sat Nov 14 03:00:12 UTC 2009


Rules keep track of their creation and last used time.  When a sub-rule
is updated, it wasn't updating the time of its super-rule.  This commit
fixes that behavior.

Thanks to Jesse Gross for the help tracking this down.
---
 ofproto/ofproto.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index b49ea49..084578c 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -2733,6 +2733,9 @@ update_time(struct ofproto *ofproto, struct rule *rule,
     long long int used = msec_from_nsec(stats->used_sec, stats->used_nsec);
     if (used > rule->used) {
         rule->used = used;
+        if (rule->super) {
+            rule->super->used = used;
+        }
         netflow_flow_update_time(ofproto->netflow, &rule->nf_flow, used);
     }
 }
-- 
1.6.4





More information about the dev mailing list