While this doesn't really create any problems it is not 100% correct to
accept such messages because, of course, the sender of an IKE_SA_INIT
request is always the original initiator of an IKE_SA.
We currently don't check the flag later, so we wouldn't notice if the
peer doesn't set it in later messages (ike_sa_id_t.equals doesn't
compare it anymore since we added support for IKEv1, in particular since
17ec1c74de).
if (message->get_request(message) &&
message->get_exchange_type(message) == IKE_SA_INIT)
{
- if (this->initiator_only || drop_ike_sa_init(this, message))
+ id = message->get_ike_sa_id(message);
+ if (this->initiator_only || !id->is_initiator(id) ||
+ drop_ike_sa_init(this, message))
{
message->destroy(message);
return JOB_REQUEUE_DIRECT;