diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-10-28 18:53:15 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-11-12 14:21:06 +0100 |
commit | 310a099be4d6f2085d05e974a7a18534d21cd215 (patch) | |
tree | d5352cefbcaac8d833d18ccfd701053978ef33ac /src | |
parent | 3af7e0927166b1f9db9acd1c13fa3fda043870ef (diff) | |
download | strongswan-310a099be4d6f2085d05e974a7a18534d21cd215.tar.bz2 strongswan-310a099be4d6f2085d05e974a7a18534d21cd215.tar.xz |
auth-cfg: Prefer merged rules over existing ones when moving them
This is particularly important for single valued rules (e.g.
identities). When copying values this is already handled correctly
by the enumerator and add().
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/credentials/auth_cfg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/credentials/auth_cfg.c b/src/libstrongswan/credentials/auth_cfg.c index 1e93f021a..9988d8021 100644 --- a/src/libstrongswan/credentials/auth_cfg.c +++ b/src/libstrongswan/credentials/auth_cfg.c @@ -951,9 +951,9 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy { entry_t entry; - while (array_remove(other->entries, ARRAY_HEAD, &entry)) - { - array_insert(this->entries, ARRAY_TAIL, &entry); + while (array_remove(other->entries, ARRAY_TAIL, &entry)) + { /* keep order but prefer new values (esp. for single valued ones) */ + array_insert(this->entries, ARRAY_HEAD, &entry); } array_compress(other->entries); } |