/* Has 'rule' expired? */
now = time_msec();
if (rule->up.hard_timeout
- && now > rule->up.created + rule->up.hard_timeout * 1000) {
+ && now > rule->up.modified + rule->up.hard_timeout * 1000) {
reason = OFPRR_HARD_TIMEOUT;
} else if (rule->up.idle_timeout && list_is_empty(&rule->facets)
&& now > rule->used + rule->up.idle_timeout * 1000) {
ovs_be64 flow_cookie; /* Controller-issued identifier. */
long long int created; /* Creation time. */
+ long long int modified; /* Time of last modification. */
uint16_t idle_timeout; /* In seconds from time of last use. */
- uint16_t hard_timeout; /* In seconds from time of creation. */
+ uint16_t hard_timeout; /* In seconds from last modification. */
uint8_t table_id; /* Index in ofproto's 'tables' array. */
bool send_flow_removed; /* Send a flow removed message? */
rule->cr = fm->cr;
rule->pending = NULL;
rule->flow_cookie = fm->cookie;
- rule->created = time_msec();
+ rule->created = rule->modified = time_msec();
rule->idle_timeout = fm->idle_timeout;
rule->hard_timeout = fm->hard_timeout;
rule->table_id = table - ofproto->tables;
rule->actions = ofputil_actions_clone(fm->actions, fm->n_actions);
rule->n_actions = fm->n_actions;
rule->ofproto->ofproto_class->rule_modify_actions(rule);
+ } else {
+ rule->modified = time_msec();
}
rule->flow_cookie = fm->cookie;
}
break;
case OFOPERATION_MODIFY:
- if (error) {
+ if (!error) {
+ rule->modified = time_msec();
+ } else {
free(rule->actions);
rule->actions = op->actions;
rule->n_actions = op->n_actions;