]> git.ipfire.org Git - thirdparty/strongswan.git/commit
load-tester: Fix race condition issuing same SPI
authorChristophe Gouault <christophe.gouault@6wind.com>
Tue, 8 Apr 2014 15:11:14 +0000 (17:11 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 24 Apr 2014 15:54:15 +0000 (17:54 +0200)
commit7b08063e70d916b16f1de2dba22110a92f7ff598
treeee68d1dde1a78f0aa6f7d0965ec1bd04b9274c02
parent2cbaa632951dd662e26e63299d8049c0d2bed8b1
load-tester: Fix race condition issuing same SPI

Due to an unprotected incrementation, two load-tester initiators occasionally
use the same SPI under high load, and hence generate 2 IPsec SAs with the same
identifier. The responder IPsec stack will refuse to configure the second SA.

Use an atomic incrementation to avoid this race condition.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
src/libcharon/plugins/load_tester/load_tester_ipsec.c