This is different if `ike` and `child` are provided and uninstall()
fails as we call that without knowing whether a matching shunt exists.
But if `ike` is not provided we explicitly search for a matching shunt
and if found don't need to look for a trap policy.
}
}
enumerator->destroy(enumerator);
- if (ike && charon->shunts->uninstall(charon->shunts, ike, child))
+ if (ike)
{
+ if (charon->shunts->uninstall(charon->shunts, ike, child))
+ {
+ free(ike);
+ return send_reply(this, NULL);
+ }
free(ike);
- return send_reply(this, NULL);
+ return send_reply(this, "uninstalling policy '%s' failed", child);
}
- free(ike);
}
else if (charon->shunts->uninstall(charon->shunts, ike, child))
{