aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-05-08 15:19:52 +0200
committerMartin Willi <martin@revosec.ch>2013-06-11 15:54:27 +0200
commit3568abe7be1efdd8d95b6711a552fefc8089fff8 (patch)
tree56769e5b57f1b0d7ca12fedf03dd9cd017f0717a
parentd64f6ef6ae3ff66b6aa775913952b637d60723f1 (diff)
downloadstrongswan-3568abe7be1efdd8d95b6711a552fefc8089fff8.tar.bz2
strongswan-3568abe7be1efdd8d95b6711a552fefc8089fff8.tar.xz
Use ref_get() to make sure IKE_SA unique IDs are unique
-rw-r--r--src/libcharon/sa/ike_sa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index d7a9076b8..e25191782 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -2169,7 +2169,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
ike_version_t version)
{
private_ike_sa_t *this;
- static u_int32_t unique_id = 0;
+ static refcount_t unique_id = 0;
if (version == IKE_ANY)
{ /* prefer IKEv2 if protocol not specified */
@@ -2281,7 +2281,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
.other_auth = auth_cfg_create(),
.my_auths = linked_list_create(),
.other_auths = linked_list_create(),
- .unique_id = ++unique_id,
+ .unique_id = ref_get(&unique_id),
.peer_addresses = linked_list_create(),
.my_vips = linked_list_create(),
.other_vips = linked_list_create(),