-/* $OpenBSD: ikev2.c,v 1.112 2014/05/09 06:37:24 markus Exp $ */
+/* $OpenBSD: ikev2.c,v 1.113 2014/05/13 14:24:35 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
if (flag) {
if ((sa->sa_stateflags & flag) == 0)
return;
+ /*
+ * We have initiated this exchange, even if
+ * we are not the initiator of the IKE SA.
+ */
initiator = 1;
}
/*
ikev2_msg_prevail(env, &sa->sa_responses, msg);
}
- if (sa_address(sa, &sa->sa_peer, &msg->msg_peer, initiator) == -1 ||
- sa_address(sa, &sa->sa_local, &msg->msg_local, initiator) == -1)
+ if (sa_address(sa, &sa->sa_peer, &msg->msg_peer,
+ sa->sa_hdr.sh_initiator) == -1 ||
+ sa_address(sa, &sa->sa_local, &msg->msg_local,
+ sa->sa_hdr.sh_initiator) == -1)
return;
sa->sa_fd = msg->msg_fd;