child-cfg: Ignore duplicate proposals
If ESP proposals are added once with and once without DH groups duplicates result during IKE_AUTH when DH groups are stripped.
This commit is contained in:
@@ -163,6 +163,11 @@ METHOD(child_cfg_t, add_proposal, void,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool match_proposal(proposal_t *item, proposal_t *proposal)
|
||||||
|
{
|
||||||
|
return item->equals(item, proposal);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(child_cfg_t, get_proposals, linked_list_t*,
|
METHOD(child_cfg_t, get_proposals, linked_list_t*,
|
||||||
private_child_cfg_t *this, bool strip_dh)
|
private_child_cfg_t *this, bool strip_dh)
|
||||||
{
|
{
|
||||||
@@ -178,6 +183,12 @@ METHOD(child_cfg_t, get_proposals, linked_list_t*,
|
|||||||
{
|
{
|
||||||
current->strip_dh(current, MODP_NONE);
|
current->strip_dh(current, MODP_NONE);
|
||||||
}
|
}
|
||||||
|
if (proposals->find_first(proposals, (linked_list_match_t)match_proposal,
|
||||||
|
NULL, current) == SUCCESS)
|
||||||
|
{
|
||||||
|
current->destroy(current);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
proposals->insert_last(proposals, current);
|
proposals->insert_last(proposals, current);
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
|||||||
Reference in New Issue
Block a user