- if (local->equals(local, this->tsr) &&
- remote->equals(remote, this->tsi) &&
- this->proposal->equals(this->proposal,
- child_sa->get_proposal(child_sa)))
- {
- this->reqid = child_sa->get_reqid(child_sa);
- this->rekey = child_sa->get_spi(child_sa, TRUE);
- child_sa->set_state(child_sa, CHILD_REKEYING);
- DBG1(DBG_IKE, "detected rekeying of CHILD_SA %s{%u}",
- child_sa->get_name(child_sa), this->reqid);
- }
+ case CHILD_INSTALLED:
+ case CHILD_REKEYING:
+ policies = child_sa->create_policy_enumerator(child_sa);
+ if (policies->enumerate(policies, &local, &remote) &&
+ local->equals(local, this->tsr) &&
+ remote->equals(remote, this->tsi) &&
+ this->proposal->equals(this->proposal, proposal))
+ {
+ this->reqid = child_sa->get_reqid(child_sa);
+ this->rekey = child_sa->get_spi(child_sa, TRUE);
+ child_sa->set_state(child_sa, CHILD_REKEYING);
+ DBG1(DBG_IKE, "detected rekeying of CHILD_SA %s{%u}",
+ child_sa->get_name(child_sa), this->reqid);
+ }
+ policies->destroy(policies);
+ break;
+ default:
+ break;