proposal: Extract proposal selection code in ike/child_cfg_t
Also invert the PREFER_CONFIGURED flag (i.e. make it PREFER_SUPPLIED) so the default, without flags, is what we preferred so far.
This commit is contained in:
@@ -568,10 +568,10 @@ static status_t select_and_install(private_child_create_t *this,
|
||||
{
|
||||
flags |= PROPOSAL_ALLOW_PRIVATE;
|
||||
}
|
||||
if (lib->settings->get_bool(lib->settings, "%s.prefer_configured_proposals",
|
||||
TRUE, lib->ns))
|
||||
if (!lib->settings->get_bool(lib->settings,
|
||||
"%s.prefer_configured_proposals", TRUE, lib->ns))
|
||||
{
|
||||
flags |= PROPOSAL_PREFER_CONFIGURED;
|
||||
flags |= PROPOSAL_PREFER_SUPPLIED;
|
||||
}
|
||||
this->proposal = this->config->select_proposal(this->config,
|
||||
this->proposals, flags);
|
||||
|
||||
@@ -462,10 +462,10 @@ static void process_sa_payload(private_ike_init_t *this, message_t *message,
|
||||
{
|
||||
flags |= PROPOSAL_ALLOW_PRIVATE;
|
||||
}
|
||||
if (lib->settings->get_bool(lib->settings, "%s.prefer_configured_proposals",
|
||||
TRUE, lib->ns))
|
||||
if (!lib->settings->get_bool(lib->settings,
|
||||
"%s.prefer_configured_proposals", TRUE, lib->ns))
|
||||
{
|
||||
flags |= PROPOSAL_PREFER_CONFIGURED;
|
||||
flags |= PROPOSAL_PREFER_SUPPLIED;
|
||||
}
|
||||
this->proposal = ike_cfg->select_proposal(ike_cfg, proposal_list, flags);
|
||||
if (!this->proposal)
|
||||
|
||||
Reference in New Issue
Block a user