diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2014-05-13 14:24:36 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2014-05-13 14:24:36 +0000 |
commit | 918d4c9c7c83208bf4f5cccafd9fa5bad5c0de36 (patch) | |
tree | 91625fc1876ec93fde0d43fb11c406698086db8b | |
parent | 94e069c1426d7ebdfd6aaa9ae7f309161f133e13 (diff) |
pass SA initiator not the exchange initator to sa_address(); ok mikeb@
-rw-r--r-- | sbin/iked/ikev2.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/iked/ikev2.c b/sbin/iked/ikev2.c index d5953cb7c29..ed958c7e70a 100644 --- a/sbin/iked/ikev2.c +++ b/sbin/iked/ikev2.c @@ -1,4 +1,4 @@ -/* $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> @@ -429,6 +429,10 @@ ikev2_recv(struct iked *env, struct iked_message *msg) 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; } /* @@ -469,8 +473,10 @@ ikev2_recv(struct iked *env, struct iked_message *msg) 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; |