From: Ben Pfaff Date: Sat, 26 Jan 2013 01:26:42 +0000 (-0800) Subject: ofproto: Maintain "expirable" list for "add" flow_mod with replaced rule. X-Git-Tag: sliver-openvswitch-1.9.90-3~3^2~21 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=d6e95e998a37a98c70dc7e91a4765c777dbc66cb ofproto: Maintain "expirable" list for "add" flow_mod with replaced rule. Commit e503cc199 (ofproto: Optimise OpenFlow flow expiry) optimized OpenFlow flow expiration by putting expirable flows on a list, but it failed to remove flows from the list when they were replaced by a new flow with an OpenFlow flow_mod "add" operation. This commit fixes the problem. Found by valgrind. CC: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 249f2d5d5..c0d94f72f 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -4858,6 +4858,9 @@ oftable_replace_rule(struct rule *rule) victim = rule_from_cls_rule(classifier_replace(&table->cls, &rule->cr)); if (victim) { + if (!list_is_empty(&victim->expirable)) { + list_remove(&victim->expirable); + } eviction_group_remove_rule(victim); } eviction_group_add_rule(rule);