From 240ad7abf5894bcdcb3756a9f5dae4154de9beae Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 27 Mar 2015 14:49:38 +0100 Subject: [PATCH] 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. --- src/libipsec/ipsec_sa_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.2