-/* $OpenBSD: iked.h,v 1.114 2017/04/13 07:04:09 patrick Exp $ */
+/* $OpenBSD: iked.h,v 1.115 2017/04/26 10:42:38 henning Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
int ikev2_childsa_delete(struct iked *, struct iked_sa *,
uint8_t, uint64_t, uint64_t *, int);
void ikev2_ikesa_recv_delete(struct iked *, struct iked_sa *);
+void ikev2_ike_sa_timeout(struct iked *env, void *);
struct ibuf *
ikev2_prfplus(struct iked_hash *, struct ibuf *, struct ibuf *,
-/* $OpenBSD: ikev2.c,v 1.153 2017/04/13 07:04:09 patrick Exp $ */
+/* $OpenBSD: ikev2.c,v 1.154 2017/04/26 10:42:38 henning Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
void ikev2_ike_sa_rekey(struct iked *, void *);
void ikev2_ike_sa_rekey_timeout(struct iked *, void *);
void ikev2_ike_sa_rekey_schedule(struct iked *, struct iked_sa *);
-void ikev2_ike_sa_timeout(struct iked *env, void *);
void ikev2_ike_sa_alive(struct iked *, void *);
void ikev2_ike_sa_keepalive(struct iked *, void *);
-/* $OpenBSD: ikev2_msg.c,v 1.51 2017/03/27 10:21:19 reyk Exp $ */
+/* $OpenBSD: ikev2_msg.c,v 1.52 2017/04/26 10:42:38 henning Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
if (sendtofrom(msg->msg_fd, ibuf_data(buf), ibuf_size(buf), 0,
(struct sockaddr *)&msg->msg_peer, msg->msg_peerlen,
(struct sockaddr *)&msg->msg_local, msg->msg_locallen) == -1) {
+ if (errno == EADDRNOTAVAIL) {
+ sa_state(env, msg->msg_sa, IKEV2_STATE_CLOSING);
+ timer_del(env, &msg->msg_sa->sa_timer);
+ timer_set(env, &msg->msg_sa->sa_timer,
+ ikev2_ike_sa_timeout, msg->msg_sa);
+ timer_add(env, &msg->msg_sa->sa_timer,
+ IKED_IKE_SA_DELETE_TIMEOUT);
+ }
log_warn("%s: sendtofrom", __func__);
return (-1);
}