Properly select IMC/IMV according to given primary ID in reserve_id()
authorTobias Brunner <tobias@strongswan.org>
Tue, 18 Dec 2012 14:49:21 +0000 (15:49 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 18 Dec 2012 14:59:29 +0000 (15:59 +0100)
src/libcharon/plugins/tnc_imc/tnc_imc_manager.c
src/libcharon/plugins/tnc_imv/tnc_imv_manager.c

index d2fce6f..bdb20d5 100644 (file)
@@ -193,7 +193,7 @@ METHOD(imc_manager_t, reserve_id, bool,
        enumerator = this->imcs->create_enumerator(this->imcs);
        while (enumerator->enumerate(enumerator, &imc))
        {
-               if (imc->get_id(imc))
+               if (id == imc->get_id(imc))
                {
                        found = TRUE;
                        *new_id = this->next_imc_id++;
index 308285d..49f5149 100644 (file)
@@ -207,7 +207,7 @@ METHOD(imv_manager_t, reserve_id, bool,
        enumerator = this->imvs->create_enumerator(this->imvs);
        while (enumerator->enumerate(enumerator, &imv))
        {
-               if (imv->get_id(imv))
+               if (id == imv->get_id(imv))
                {
                        found = TRUE;
                        *new_id = this->next_imv_id++;