ofproto: Update time of super-rule to match sub-rule
authorJustin Pettit <jpettit@nicira.com>
Sat, 14 Nov 2009 02:53:28 +0000 (18:53 -0800)
committerJustin Pettit <jpettit@nicira.com>
Sat, 14 Nov 2009 22:20:16 +0000 (14:20 -0800)
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

index b49ea49..2894e2d 100644 (file)
@@ -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 && used > rule->super->used) {
+            rule->super->used = used;
+        }
         netflow_flow_update_time(ofproto->netflow, &rule->nf_flow, used);
     }
 }