From 415403bc073db310bf8ad65abed26f6253c78c3c Mon Sep 17 00:00:00 2001 From: Hans-Joerg Hoexer Date: Fri, 8 Apr 2005 16:32:12 +0000 Subject: improve logging, original diff and ok cloder@ --- sbin/isakmpd/transport.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'sbin/isakmpd/transport.c') diff --git a/sbin/isakmpd/transport.c b/sbin/isakmpd/transport.c index 49706b5fe1a..96188986f30 100644 --- a/sbin/isakmpd/transport.c +++ b/sbin/isakmpd/transport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: transport.c,v 1.31 2005/04/04 19:31:11 deraadt Exp $ */ +/* $OpenBSD: transport.c,v 1.32 2005/04/08 16:32:11 hshoexer Exp $ */ /* $EOM: transport.c,v 1.43 2000/10/10 12:36:39 provos Exp $ */ /* @@ -32,6 +32,7 @@ #include #include +#include #include #include "sysdep.h" @@ -267,8 +268,10 @@ transport_send_messages(fd_set * fds) struct transport *t, *next; struct message *msg; struct exchange *exchange; + struct sockaddr *dst; struct timeval expiration; int expiry, ok_to_drop_message; + char peer[NI_MAXHOST], peersv[NI_MAXSERV]; /* * Reference all transports first so noone will disappear while in @@ -322,29 +325,19 @@ transport_send_messages(fd_set * fds) if ((msg->flags & MSG_LAST) == 0) { if (msg->xmits > conf_get_num("General", "retransmits", RETRANSMIT_DEFAULT)) { + t->virtual->vtbl->get_dst(t->virtual, &dst); + if (getnameinfo(dst, sysdep_sa_len(dst), + peer, sizeof peer, peersv, sizeof peersv, + NI_NUMERICHOST | NI_NUMERICSERV)) { + strlcpy(peer, "", sizeof peer); + strlcpy(peersv, "", sizeof peersv); + } log_print("transport_send_messages: " - "giving up on message %p, " - "exchange %s", msg, + "giving up on exchange %s, no " + "response from peer %s:%s", exchange->name ? exchange->name : - ""); - /* Be more verbose here. */ - if (exchange->phase == 1) { - log_print( - "transport_send_messages: " - "either this message did " - "not reach the other " - "peer"); - if (exchange->initiator) - log_print("transport_send_messages: " - "or the response" - "message did not " - "reach us back"); - else - log_print("transport_send_messages: " - "or this is an " - "attempted IKE " - "scan"); - } + "", peer, peersv); + exchange->last_sent = 0; #ifdef notyet exchange_free(exchange); -- cgit v1.2.3