From: Tobias Brunner Date: Fri, 27 Mar 2015 13:49:38 +0000 (+0100) Subject: libipsec: Insert SAs first, so latest SA with the same reqid gets used X-Git-Tag: 5.3.1rc1~14^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=240ad7abf5894bcdcb3756a9f5dae4154de9beae;p=thirdparty%2Fstrongswan.git libipsec: Insert SAs first, so latest SA with the same reqid gets used This was useful for testing purposes of RADIUS accounting, but OS kernels generally will use the latest SA, so we do the same. --- diff --git a/src/libipsec/ipsec_sa_mgr.c b/src/libipsec/ipsec_sa_mgr.c index 07ffa9e4f3..9d461f2c13 100644 --- a/src/libipsec/ipsec_sa_mgr.c +++ b/src/libipsec/ipsec_sa_mgr.c @@ -482,7 +482,7 @@ METHOD(ipsec_sa_mgr_t, add_sa, status_t, entry = create_entry(sa_new); schedule_expiration(this, entry); - this->sas->insert_last(this->sas, entry); + this->sas->insert_first(this->sas, entry); this->mutex->unlock(this->mutex); return SUCCESS;