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.
This commit is contained in:
Tobias Brunner
2016-06-06 14:17:11 +02:00
parent e35bb6e946
commit b2abd01048
+2 -1
View File
@@ -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 = {