]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
insert IMV/IMC before providing BindFunction
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 7 Nov 2010 23:29:44 +0000 (00:29 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 9 Nov 2010 19:43:50 +0000 (20:43 +0100)
src/libcharon/plugins/tnc_imc/tnc_imc.c
src/libcharon/plugins/tnc_imc/tnc_imc_manager.c
src/libcharon/plugins/tnc_imv/tnc_imv.c
src/libcharon/plugins/tnc_imv/tnc_imv_manager.c
src/libcharon/tnc/imc/imc.h

index 7c1b7b5b2989ae3e5b152978f443ca46da60e184..7664b6142c420e04f84278d01d360381d71c7639 100644 (file)
@@ -88,6 +88,7 @@ METHOD(imc_t, set_message_types, void,
                this->supported_types = malloc(size);
                memcpy(this->supported_types, supported_types, size);
        }
+       DBG2(DBG_TNC, "IMC %u supports %u message types", this->id, type_count);
 }
 
 METHOD(imc_t, type_supported, bool,
index f1d0f2101a7f350a17a40cdc7a7d86a032f87604..da10274f13f8acb641dde686fb3c809d86da9f12 100644 (file)
@@ -59,6 +59,9 @@ METHOD(imc_manager_t, add, bool,
                                           imc->get_name(imc));
                return FALSE;
        }
+       this->imcs->insert_last(this->imcs, imc);
+       this->next_imc_id++;
+
     if (imc->provide_bind_function(imc->get_id(imc), TNC_TNCC_BindFunction)
                        != TNC_RESULT_SUCCESS)
        {
@@ -66,8 +69,6 @@ METHOD(imc_manager_t, add, bool,
                                           imc->get_name(imc));
                return FALSE;
        }
-       this->imcs->insert_last(this->imcs, imc);
-       this->next_imc_id++;
 
        return TRUE;
 }
index 2eca072bb557b4edb27c4413c6d062c2fa6fbff7..a685b91dd545d219e95aca1dc50085f97ff65928 100644 (file)
@@ -88,6 +88,7 @@ METHOD(imv_t, set_message_types, void,
                this->supported_types = malloc(size);
                memcpy(this->supported_types, supported_types, size);
        }
+       DBG2(DBG_TNC, "IMV %u supports %u message types", this->id, type_count);
 }
 
 METHOD(imv_t, type_supported, bool,
index 08bc09392c2aac55a9f34db06806b1f54774c439..4beaccc078aecfe45013d2c39a2e32c8c4ad1116 100644 (file)
@@ -59,6 +59,9 @@ METHOD(imv_manager_t, add, bool,
                                           imv->get_name(imv));
                return FALSE;
        }
+       this->imvs->insert_last(this->imvs, imv);
+       this->next_imv_id++;
+
     if (imv->provide_bind_function(imv->get_id(imv), TNC_TNCS_BindFunction)
                        != TNC_RESULT_SUCCESS)
        {
@@ -66,8 +69,6 @@ METHOD(imv_manager_t, add, bool,
                                           imv->get_name(imv));
                return FALSE;
        }
-       this->imvs->insert_last(this->imvs, imv);
-       this->next_imv_id++;
        return TRUE;
 }
 
index 8d3f4af94dd2dca2f05efc0c451aec3aaceff8e6..affaadd8bc06784ac316a810848d180197c72353 100644 (file)
@@ -24,7 +24,7 @@
 #include <tnc/tncifimc.h>
 #include <library.h>
 
-/typedef struct imc_t imc_t;
+typedef struct imc_t imc_t;
 
 /**
  * Controls a single Integrity Measurement Collector (IMC)