Daniel Prevett <[EMAIL PROTECTED]> writes:

> I've been using lsh in conjunction with Van Dyke's product SecureFX, which
> bundles SSH2 port forwarding into an FTP client to forward both channels
> of an FTP session.

I've found a bug causing forwarded connections not to be closed properly.

Can you try this patch?

/Niels

diff -u -r1.49 -r1.50
--- tcpforward.c        2000/06/01 13:18:12     1.49
+++ tcpforward.c        2000/06/20 06:57:27     1.50
@@ -149,6 +149,7 @@
     channel_close(c);
 }
 
+/* NOTE: Adds the socket to the channel's resource list */
 struct ssh_channel *
 make_tcpip_channel(struct lsh_fd *socket, UINT32 initial_window)
 {
@@ -168,6 +169,8 @@
   self->super.rec_max_packet = SSH_MAX_PACKET - SSH_CHANNEL_MAX_PACKET_FUZZ;
   
   self->socket = socket;
+
+  REMEMBER_RESOURCE(self->super.resources, socket);
   
   return &self->super;
 }
diff -u -r1.26 -r1.27
--- tcpforward_commands.c       2000/05/06 11:12:22     1.26
+++ tcpforward_commands.c       2000/06/20 06:57:28     1.27
@@ -150,14 +150,13 @@
   struct ssh_channel *channel;
 
   /* NOTE: All accepted fd:s must end up in this function, so it
-   * should be ok to delay the REMEMBER() call until here. */
+   * should be ok to delay the REMEMBER() call until here. It is done
+   * by make_tcpip_channel(). */
 
   debug("tcpforward_commands.c: new_tcpip_channel()\n");
 
   channel = make_tcpip_channel(self->peer->fd, TCPIP_WINDOW_SIZE);
   channel->write = connection->write;
-
-  REMEMBER_RESOURCE(channel->resources, &self->peer->fd->super);
 
   *request = format_channel_open(self->type, local_channel_number,
                                 channel, 

Reply via email to