summaryrefslogtreecommitdiff
path: root/src/libcharon/config/child_cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/config/child_cfg.c')
-rw-r--r--src/libcharon/config/child_cfg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libcharon/config/child_cfg.c b/src/libcharon/config/child_cfg.c
index ec2a12431..3d110e9a2 100644
--- a/src/libcharon/config/child_cfg.c
+++ b/src/libcharon/config/child_cfg.c
@@ -224,6 +224,10 @@ METHOD(child_cfg_t, select_proposal, proposal_t*,
while (prefer_enum->enumerate(prefer_enum, &proposal))
{
proposal = proposal->clone(proposal);
+ if (strip_dh)
+ {
+ proposal->strip_dh(proposal, MODP_NONE);
+ }
if (prefer_self)
{
proposals->reset_enumerator(proposals, match_enum);
@@ -234,11 +238,13 @@ METHOD(child_cfg_t, select_proposal, proposal_t*,
}
while (match_enum->enumerate(match_enum, &match))
{
+ match = match->clone(match);
if (strip_dh)
{
- proposal->strip_dh(proposal, MODP_NONE);
+ match->strip_dh(match, MODP_NONE);
}
selected = proposal->select(proposal, match, prefer_self, private);
+ match->destroy(match);
if (selected)
{
DBG2(DBG_CFG, "received proposals: %#P", proposals);