Due to an unprotected incrementation, two load-tester initiators occasionally
use the same identifier under high load. The responder typically drops one of
the connections.
Use an atomic incrementation to avoid this race condition.
Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
/**
* incremental numbering of generated configs
*/
- u_int num;
+ refcount_t num;
/**
* Dynamic source port, if used
{
if (streq(name, "load-test"))
{
- return generate_config(this, this->num++);
+ return generate_config(this, (u_int)ref_get(&this->num));
}
return NULL;
}