From: Justin Pettit Date: Wed, 17 Jul 2013 06:05:10 +0000 (-0700) Subject: ofproto-dpif: Expire fin_timeout actions when no previous timeout set. X-Git-Tag: sliver-openvswitch-2.0.90-1~36^2~11 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2a5183ac07277f7a57052fd6d082523011339521;p=sliver-openvswitch.git ofproto-dpif: Expire fin_timeout actions when no previous timeout set. Commit e503cc199 (ofproto: Optimise OpenFlow flow expiry) optimized OpenFlow flow expiration by putting expirable flows on a list. However, the list is only configured at rule creation time. If the rule is created without a timeout, but is later set by the fin_timeout action, it will never expire. This commit adds the rule to the list when the action is triggered. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 0507f8eb8..bd96910e9 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -1835,6 +1835,10 @@ xlate_fin_timeout(struct xlate_ctx *ctx, if (ctx->xin->tcp_flags & (TCP_FIN | TCP_RST) && ctx->rule) { struct rule_dpif *rule = ctx->rule; + if (list_is_empty(&rule->up.expirable)) { + list_insert(&rule->up.ofproto->expirable, &rule->up.expirable); + } + reduce_timeout(oft->fin_idle_timeout, &rule->up.idle_timeout); reduce_timeout(oft->fin_hard_timeout, &rule->up.hard_timeout); }