=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/channels.c,v retrieving revision 1.327 retrieving revision 1.328 diff -u -r1.327 -r1.328 --- src/usr.bin/ssh/channels.c 2013/11/08 00:39:15 1.327 +++ src/usr.bin/ssh/channels.c 2013/12/19 01:04:36 1.328 @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.327 2013/11/08 00:39:15 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.328 2013/12/19 01:04:36 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1377,6 +1377,8 @@ { int direct; char buf[1024]; + char *local_ipaddr = get_local_ipaddr(c->sock); + int local_port = get_sock_port(c->sock, 1); char *remote_ipaddr = get_peer_ipaddr(c->sock); int remote_port = get_peer_port(c->sock); @@ -1391,9 +1393,9 @@ snprintf(buf, sizeof buf, "%s: listening port %d for %.100s port %d, " - "connect from %.200s port %d", + "connect from %.200s port %d to %.100s port %d", rtype, c->listening_port, c->path, c->host_port, - remote_ipaddr, remote_port); + remote_ipaddr, remote_port, local_ipaddr, local_port); free(c->remote_name); c->remote_name = xstrdup(buf); @@ -1411,7 +1413,7 @@ } else { /* listen address, port */ packet_put_cstring(c->path); - packet_put_int(c->listening_port); + packet_put_int(local_port); } /* originator host and port */ packet_put_cstring(remote_ipaddr); @@ -1428,6 +1430,7 @@ packet_send(); } free(remote_ipaddr); + free(local_ipaddr); } static void