On 10/17/17, Darren Tucker <[email protected]> wrote:
[snip]
> probably better to use fmt_connection_id() instead of hand-rolling the
> format.
Ok. I have added fmt_connection_id() to serverloop.c from packet.c
/Lars
Index: src/usr.bin/ssh/serverloop.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/serverloop.c,v
retrieving revision 1.198
diff -u -p -u -r1.198 serverloop.c
--- src/usr.bin/ssh/serverloop.c 12 Sep 2017 06:35:32 -0000 1.198
+++ src/usr.bin/ssh/serverloop.c 17 Oct 2017 09:57:34 -0000
@@ -162,10 +162,12 @@ 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 +870,12 @@ server_init_dispatch(void)
/* rekeying */
dispatch_set(SSH2_MSG_KEXINIT, &kex_input_kexinit);
}
+
+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));
+}
+