[BACK]Return to channels.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/channels.c between version 1.86 and 1.87

version 1.86, 2001/01/31 19:26:19 version 1.87, 2001/01/31 20:37:22
Line 1531 
Line 1531 
  * Initiate forwarding of connections to local port "port" through the secure   * Initiate forwarding of connections to local port "port" through the secure
  * channel to host:port from remote side.   * channel to host:port from remote side.
  */   */
 void  int
 channel_request_local_forwarding(u_short listen_port, const char *host_to_connect,  channel_request_local_forwarding(u_short listen_port, const char *host_to_connect,
     u_short port_to_connect, int gateway_ports)      u_short port_to_connect, int gateway_ports)
 {  {
         channel_request_forwarding(          return channel_request_forwarding(
             NULL, listen_port,              NULL, listen_port,
             host_to_connect, port_to_connect,              host_to_connect, port_to_connect,
             gateway_ports, /*remote_fwd*/ 0);              gateway_ports, /*remote_fwd*/ 0);
Line 1545 
Line 1545 
  * If 'remote_fwd' is true we have a '-R style' listener for protocol 2   * If 'remote_fwd' is true we have a '-R style' listener for protocol 2
  * (SSH_CHANNEL_RPORT_LISTENER).   * (SSH_CHANNEL_RPORT_LISTENER).
  */   */
 void  int
 channel_request_forwarding(  channel_request_forwarding(
     const char *listen_address, u_short listen_port,      const char *listen_address, u_short listen_port,
     const char *host_to_connect, u_short port_to_connect,      const char *host_to_connect, u_short port_to_connect,
Line 1557 
Line 1557 
         const char *host;          const char *host;
         struct linger linger;          struct linger linger;
   
           success = 0;
   
         if (remote_fwd) {          if (remote_fwd) {
                 host = listen_address;                  host = listen_address;
                 ctype = SSH_CHANNEL_RPORT_LISTENER;                  ctype = SSH_CHANNEL_RPORT_LISTENER;
Line 1565 
Line 1567 
                 ctype  =SSH_CHANNEL_PORT_LISTENER;                  ctype  =SSH_CHANNEL_PORT_LISTENER;
         }          }
   
         if (strlen(host) > sizeof(channels[0].path) - 1)          if (strlen(host) > sizeof(channels[0].path) - 1) {
                 packet_disconnect("Forward host name too long.");                  error("Forward host name too long.");
                   return success;
           }
   
         /* XXX listen_address is currently ignored */          /* XXX listen_address is currently ignored */
         /*          /*
Line 1581 
Line 1585 
         if (getaddrinfo(NULL, strport, &hints, &aitop) != 0)          if (getaddrinfo(NULL, strport, &hints, &aitop) != 0)
                 packet_disconnect("getaddrinfo: fatal error");                  packet_disconnect("getaddrinfo: fatal error");
   
         success = 0;  
         for (ai = aitop; ai; ai = ai->ai_next) {          for (ai = aitop; ai; ai = ai->ai_next) {
                 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)                  if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
                         continue;                          continue;
Line 1630 
Line 1633 
                 success = 1;                  success = 1;
         }          }
         if (success == 0)          if (success == 0)
                 packet_disconnect("cannot listen port: %d", listen_port);       /*XXX ?disconnect? */                  error("channel_request_forwarding: cannot listen to port: %d",
                       listen_port);
         freeaddrinfo(aitop);          freeaddrinfo(aitop);
           return success;
 }  }
   
 /*  /*

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.87