From: Tobias Brunner Date: Thu, 19 May 2016 09:56:44 +0000 (+0200) Subject: child-sa: Use non-static variable to store generated unique mark X-Git-Tag: 5.5.0dr1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2abd010484cd1858d3ca1b9110ea37070eec073;p=thirdparty%2Fstrongswan.git child-sa: Use non-static variable to store generated unique mark If two CHILD_SAs with mark=%unique are created concurrently they could otherwise end up with either the same mark or different marks in both directions. --- diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c index e75e399053..8a405d93ce 100644 --- a/src/libcharon/sa/child_sa.c +++ b/src/libcharon/sa/child_sa.c @@ -1390,7 +1390,8 @@ child_sa_t * child_sa_create(host_t *me, host_t* other, u_int mark_in, u_int mark_out) { private_child_sa_t *this; - static refcount_t unique_id = 0, unique_mark = 0, mark; + static refcount_t unique_id = 0, unique_mark = 0; + refcount_t mark; INIT(this, .public = {