]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
libipsec: Insert SAs first, so latest SA with the same reqid gets used
authorTobias Brunner <tobias@strongswan.org>
Fri, 27 Mar 2015 13:49:38 +0000 (14:49 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 21 May 2015 13:38:31 +0000 (15:38 +0200)
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

index 07ffa9e4f351ee8260e44da3597a3d98828c5eab..9d461f2c1318c66c28b21f6fe2cf14fffd7e2dd5 100644 (file)
@@ -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;