- reworked usage of IDs in various states

- using ID_ANY for any, not NULL as before
- initiator sends IDr payload in IKE_AUTH when ID unique
This commit is contained in:
Martin Willi
2006-04-27 11:38:24 +00:00
parent f1e87b9022
commit eea353466e
15 changed files with 248 additions and 135 deletions
@@ -66,7 +66,7 @@ static policy_t *get_policy(private_local_policy_store_t *this, identification_t
iterator_t *iterator;
policy_t *current, *found = NULL;
this->logger->log(this->logger, CONTROL|LEVEL0, "Looking for policy for IDs %s - %s",
this->logger->log(this->logger, CONTROL|LEVEL1, "Looking for policy for IDs %s - %s",
my_id ? my_id->get_string(my_id) : "%any",
other_id->get_string(other_id));
iterator = this->policies->create_iterator(this->policies, TRUE);
@@ -76,7 +76,7 @@ static policy_t *get_policy(private_local_policy_store_t *this, identification_t
identification_t *config_my_id = current->get_my_id(current);
identification_t *config_other_id = current->get_other_id(current);
this->logger->log(this->logger, CONTROL|LEVEL0, "Found one for %s - %s",
this->logger->log(this->logger, CONTROL|LEVEL2, "Found one for %s - %s",
config_my_id->get_string(config_my_id),
config_other_id->get_string(config_other_id));
@@ -84,11 +84,6 @@ static policy_t *get_policy(private_local_policy_store_t *this, identification_t
if (other_id->belongs_to(other_id, config_other_id))
{
/* get it if my_id not specified */
if (my_id == NULL)
{
found = current->clone(current);
break;
}
if (my_id->belongs_to(my_id, config_my_id))
{
found = current->clone(current);
@@ -101,10 +96,7 @@ static policy_t *get_policy(private_local_policy_store_t *this, identification_t
/* apply IDs as they are requsted, since they may be configured as %any or such */
if (found)
{
if (my_id)
{
found->update_my_id(found, my_id->clone(my_id));
}
found->update_my_id(found, my_id->clone(my_id));
found->update_other_id(found, other_id->clone(other_id));
}
return found;
+1 -1
View File
@@ -79,7 +79,7 @@ struct policy_t {
void (*update_my_id) (policy_t *this, identification_t *my_id);
/**
* @brief Update others id.
* @brief Update others ID.
*
* It may be necessary to uptdate others ID, as it
* is set to %any or to e.g. *@strongswan.org in