diff options
author | Tobias Brunner <tobias@strongswan.org> | 2016-05-19 11:56:44 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2016-06-06 14:17:11 +0200 |
commit | b2abd010484cd1858d3ca1b9110ea37070eec073 (patch) | |
tree | 820672c88c7d46c760c56cc4a3e63d599a44ba81 /src | |
parent | e35bb6e9462aa90c0ac508a1083d411762015c1e (diff) | |
download | strongswan-b2abd010484cd1858d3ca1b9110ea37070eec073.tar.bz2 strongswan-b2abd010484cd1858d3ca1b9110ea37070eec073.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/sa/child_sa.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c index e75e39905..8a405d93c 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 = { |