summaryrefslogtreecommitdiff
path: root/lib/conntrack-private.h
diff options
context:
space:
mode:
authorDarrell Ball <dlu998@gmail.com>2019-05-28 11:14:42 -0700
committerBen Pfaff <blp@ovn.org>2019-06-05 14:58:43 -0700
commit5f918a8a4d4a775b9c1239657afcd73af3ec9827 (patch)
tree40c490469bd21dda4c9e2106f91a62ad4f0165d1 /lib/conntrack-private.h
parent52d12cc4590d5b95505a21d3508586db3bb35d07 (diff)
downloadopenvswitch-5f918a8a4d4a775b9c1239657afcd73af3ec9827.tar.gz
conntrack: Don't re-add cleaned 'conn' to expiry list.
When a 'conn' entry is cleaned up from an expiry list, we don't want to put it back during an update. Hence, we detect and block this. Fixes: 967bb5c5cd90 ("conntrack: Add rcu support.") Signed-off-by: Darrell Ball <dlu998@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/conntrack-private.h')
-rw-r--r--lib/conntrack-private.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/conntrack-private.h b/lib/conntrack-private.h
index 51b7d7f76..bcfbe104b 100644
--- a/lib/conntrack-private.h
+++ b/lib/conntrack-private.h
@@ -102,11 +102,12 @@ struct conn {
/* Mutable data. */
struct ovs_mutex lock; /* Guards all mutable fields. */
ovs_u128 label;
- uint32_t mark;
long long expiration;
+ uint32_t mark;
int seq_skew;
bool seq_skew_dir; /* TCP sequence skew direction due to NATTing of FTP
* control messages; true if reply direction. */
+ bool cleaned; /* True if cleaned from expiry lists. */
/* Immutable data. */
bool alg_related; /* True if alg data connection. */
@@ -218,9 +219,11 @@ conn_update_expiration(struct conntrack *ct, struct conn *conn,
ovs_mutex_lock(&ct->ct_lock);
ovs_mutex_lock(&conn->lock);
- conn->expiration = now + ct_timeout_val[tm];
- ovs_list_remove(&conn->exp_node);
- ovs_list_push_back(&ct->exp_lists[tm], &conn->exp_node);
+ if (!conn->cleaned) {
+ conn->expiration = now + ct_timeout_val[tm];
+ ovs_list_remove(&conn->exp_node);
+ ovs_list_push_back(&ct->exp_lists[tm], &conn->exp_node);
+ }
ovs_mutex_unlock(&conn->lock);
ovs_mutex_unlock(&ct->ct_lock);