ike-cfg: remove the to be obsoleted allow any parameter in get_my/other_addr
This commit is contained in:
@@ -135,7 +135,6 @@ METHOD(backend_manager_t, get_ike_cfg, ike_cfg_t*,
|
||||
{
|
||||
ike_cfg_t *current, *found = NULL;
|
||||
char *my_addr, *other_addr;
|
||||
bool my_allow_any, other_allow_any;
|
||||
enumerator_t *enumerator;
|
||||
ike_cfg_match_t match, best = MATCH_ANY;
|
||||
ike_data_t *data;
|
||||
@@ -159,11 +158,10 @@ METHOD(backend_manager_t, get_ike_cfg, ike_cfg_t*,
|
||||
match, me, other, ike_version_names, version);
|
||||
if (match)
|
||||
{
|
||||
my_addr = current->get_my_addr(current, &my_allow_any);
|
||||
other_addr = current->get_other_addr(current, &other_allow_any);
|
||||
DBG2(DBG_CFG, " candidate: %s%s...%s%s, prio %d",
|
||||
my_allow_any ? "%":"", my_addr,
|
||||
other_allow_any ? "%":"", other_addr, match);
|
||||
my_addr = current->get_my_addr(current);
|
||||
other_addr = current->get_other_addr(current);
|
||||
DBG2(DBG_CFG, " candidate: %s...%s, prio %d",
|
||||
my_addr, other_addr, match);
|
||||
if (match > best)
|
||||
{
|
||||
DESTROY_IF(found);
|
||||
@@ -177,11 +175,10 @@ METHOD(backend_manager_t, get_ike_cfg, ike_cfg_t*,
|
||||
this->lock->unlock(this->lock);
|
||||
if (found)
|
||||
{
|
||||
my_addr = found->get_my_addr(found, &my_allow_any);
|
||||
other_addr = found->get_other_addr(found, &other_allow_any);
|
||||
DBG2(DBG_CFG, "found matching ike config: %s%s...%s%s with prio %d",
|
||||
my_allow_any ? "%":"", my_addr,
|
||||
other_allow_any ? "%":"", other_addr, best);
|
||||
my_addr = found->get_my_addr(found);
|
||||
other_addr = found->get_other_addr(found);
|
||||
DBG2(DBG_CFG, "found matching ike config: %s...%s with prio %d",
|
||||
my_addr, other_addr, best);
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -186,22 +186,14 @@ METHOD(ike_cfg_t, match_other, u_int,
|
||||
}
|
||||
|
||||
METHOD(ike_cfg_t, get_my_addr, char*,
|
||||
private_ike_cfg_t *this, bool *allow_any)
|
||||
private_ike_cfg_t *this)
|
||||
{
|
||||
if (allow_any)
|
||||
{
|
||||
*allow_any = this->my_allow_any;
|
||||
}
|
||||
return this->me;
|
||||
}
|
||||
|
||||
METHOD(ike_cfg_t, get_other_addr, char*,
|
||||
private_ike_cfg_t *this, bool *allow_any)
|
||||
private_ike_cfg_t *this)
|
||||
{
|
||||
if (allow_any)
|
||||
{
|
||||
*allow_any = this->other_allow_any;
|
||||
}
|
||||
return this->other;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,18 +112,16 @@ struct ike_cfg_t {
|
||||
/**
|
||||
* Get own address.
|
||||
*
|
||||
* @param allow_any allow any address to match
|
||||
* @return string of address/DNS name
|
||||
*/
|
||||
char* (*get_my_addr) (ike_cfg_t *this, bool *allow_any);
|
||||
char* (*get_my_addr) (ike_cfg_t *this);
|
||||
|
||||
/**
|
||||
* Get peer's address.
|
||||
*
|
||||
* @param allow_any allow any address to match
|
||||
* @return string of address/DNS name
|
||||
*/
|
||||
char* (*get_other_addr) (ike_cfg_t *this, bool *allow_any);
|
||||
char* (*get_other_addr) (ike_cfg_t *this);
|
||||
|
||||
/**
|
||||
* Get the port to use as our source port.
|
||||
|
||||
@@ -309,9 +309,9 @@ static void request_query_config(xmlTextReaderPtr reader, xmlTextWriterPtr write
|
||||
ike_cfg = peer_cfg->get_ike_cfg(peer_cfg);
|
||||
xmlTextWriterStartElement(writer, "ikeconfig");
|
||||
xmlTextWriterWriteElement(writer, "local",
|
||||
ike_cfg->get_my_addr(ike_cfg, NULL));
|
||||
ike_cfg->get_my_addr(ike_cfg));
|
||||
xmlTextWriterWriteElement(writer, "remote",
|
||||
ike_cfg->get_other_addr(ike_cfg, NULL));
|
||||
ike_cfg->get_other_addr(ike_cfg));
|
||||
xmlTextWriterEndElement(writer);
|
||||
/* </ikeconfig> */
|
||||
|
||||
|
||||
@@ -824,7 +824,7 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strchr(ike_cfg->get_my_addr(ike_cfg, NULL), ':'))
|
||||
if (strchr(ike_cfg->get_my_addr(ike_cfg), ':'))
|
||||
{
|
||||
vip = host_create_any(AF_INET6);
|
||||
}
|
||||
|
||||
@@ -555,10 +555,8 @@ METHOD(stroke_list_t, status, void,
|
||||
ike_version = peer_cfg->get_ike_version(peer_cfg);
|
||||
my_addr = ike_cfg->get_my_addr(ike_cfg, &my_allow_any);
|
||||
other_addr = ike_cfg->get_other_addr(ike_cfg, &other_allow_any);
|
||||
fprintf(out, "%12s: %s%s...%s%s %N", peer_cfg->get_name(peer_cfg),
|
||||
my_allow_any ? "%":"", my_addr,
|
||||
other_allow_any ? "%":"", other_addr,
|
||||
ike_version_names, ike_version);
|
||||
fprintf(out, "%12s: %s...%s %N", peer_cfg->get_name(peer_cfg),
|
||||
my_addr, other_addr, ike_version_names, ike_version);
|
||||
|
||||
if (ike_version == IKEV1 && peer_cfg->use_aggressive(peer_cfg))
|
||||
{
|
||||
|
||||
@@ -1166,7 +1166,7 @@ METHOD(ike_sa_t, initiate, status_t,
|
||||
host_t *host;
|
||||
char *addr;
|
||||
|
||||
addr = this->ike_cfg->get_my_addr(this->ike_cfg, NULL);
|
||||
addr = this->ike_cfg->get_my_addr(this->ike_cfg);
|
||||
host = this->ike_cfg->resolve_other(this->ike_cfg, AF_UNSPEC);
|
||||
is_anyaddr = host && host->is_anyaddr(host);
|
||||
DESTROY_IF(host);
|
||||
|
||||
Reference in New Issue
Block a user