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 b49ea49f4f97b3fb29b331f457d18698d75b492b..2894e2d331e9799f8c4c2788d2e361ed6d4fca60 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);
     }
 }