From 0c43ad9a7501774ba33e55e8b5367e611ff0057f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 11 Nov 2010 11:04:10 -0800 Subject: [PATCH] ofproto: Fix used time of revalidated subrules. 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 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index dbde7c04..8348868b 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; /* Time last used; time created if not used. */ long long int created; /* Creation time. */ uint64_t packet_count; /* Number of packets received. */ uint64_t byte_count; /* Number of bytes received. */ @@ -4823,8 +4823,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; } } -- 2.30.2