Here is a replacement patch.

/Lars

Index: serverloop.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/serverloop.c,v
retrieving revision 1.198
diff -u -p -u -r1.198 serverloop.c
--- serverloop.c        12 Sep 2017 06:35:32 -0000      1.198
+++ serverloop.c        17 Oct 2017 18:10:13 -0000
@@ -159,13 +159,24 @@ sigterm_handler(int sig)
 }

 static void
+fmt_connection_id(struct ssh *ssh, char *s, size_t l)
+{
+       snprintf(s, l, "%.200s%s%s port %d",
+           ssh->log_preamble ? ssh->log_preamble : "",
+           ssh->log_preamble ? " " : "",
+           ssh_remote_ipaddr(ssh), ssh_remote_port(ssh));
+}
+
+static void
 client_alive_check(struct ssh *ssh)
 {
        int channel_id;
+       char remote_id[512];

        /* timeout, check to see how many we have had */
        if (packet_inc_alive_timeouts() > options.client_alive_count_max) {
-               logit("Timeout, client not responding.");
+               fmt_connection_id(ssh, remote_id, sizeof(remote_id));
+               logit("Timeout, client not responding from %s", remote_id);
                cleanup_exit(255);
        }

@@ -868,3 +879,4 @@ server_init_dispatch(void)
        /* rekeying */
        dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit);
 }
+

Reply via email to