return 1;
}
+static void wrap_send_port_open(void *channel, const char *hostname, int port,
+ Socket s)
+{
+ char *peerinfo, *description;
+ peerinfo = sk_peer_info(s);
+ if (peerinfo) {
+ description = dupprintf("forwarding from %s", peerinfo);
+ sfree(peerinfo);
+ } else {
+ description = dupstr("forwarding");
+ }
+ ssh_send_port_open(channel, hostname, port, description);
+ sfree(description);
+}
+
static int pfd_receive(Plug plug, int urgent, char *data, int len)
{
struct PortForwarding *pf = (struct PortForwarding *) plug;
return 1;
} else {
/* asks to forward to the specified host/port for this */
- ssh_send_port_open(pf->c, pf->hostname, pf->port, "forwarding");
+ wrap_send_port_open(pf->c, pf->hostname, pf->port, pf->s);
}
pf->dynamic = 0;
return 1;
} else {
/* asks to forward to the specified host/port for this */
- ssh_send_port_open(pf->c, pf->hostname, pf->port, "forwarding");
+ wrap_send_port_open(pf->c, pf->hostname, pf->port, s);
}
}