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

Diff for /src/usr.bin/ssh/clientloop.c between version 1.288 and 1.289

version 1.288, 2016/09/17 18:00:27 version 1.289, 2016/09/30 09:19:13
Line 1871 
Line 1871 
 }  }
   
 static Channel *  static Channel *
 client_request_forwarded_tcpip(const char *request_type, int rchan)  client_request_forwarded_tcpip(const char *request_type, int rchan,
       u_int rwindow, u_int rmaxpack)
 {  {
         Channel *c = NULL;          Channel *c = NULL;
           struct sshbuf *b = NULL;
         char *listen_address, *originator_address;          char *listen_address, *originator_address;
         u_short listen_port, originator_port;          u_short listen_port, originator_port;
           int r;
   
         /* Get rest of the packet */          /* Get rest of the packet */
         listen_address = packet_get_string(NULL);          listen_address = packet_get_string(NULL);
Line 1890 
Line 1893 
         c = channel_connect_by_listen_address(listen_address, listen_port,          c = channel_connect_by_listen_address(listen_address, listen_port,
             "forwarded-tcpip", originator_address);              "forwarded-tcpip", originator_address);
   
           if (c != NULL && c->type == SSH_CHANNEL_MUX_CLIENT) {
                   if ((b = sshbuf_new()) == NULL) {
                           error("%s: alloc reply", __func__);
                           goto out;
                   }
                   /* reconstruct and send to muxclient */
                   if ((r = sshbuf_put_u8(b, 0)) != 0 ||   /* padlen */
                       (r = sshbuf_put_u8(b, SSH2_MSG_CHANNEL_OPEN)) != 0 ||
                       (r = sshbuf_put_cstring(b, request_type)) != 0 ||
                       (r = sshbuf_put_u32(b, rchan)) != 0 ||
                       (r = sshbuf_put_u32(b, rwindow)) != 0 ||
                       (r = sshbuf_put_u32(b, rmaxpack)) != 0 ||
                       (r = sshbuf_put_cstring(b, listen_address)) != 0 ||
                       (r = sshbuf_put_u32(b, listen_port)) != 0 ||
                       (r = sshbuf_put_cstring(b, originator_address)) != 0 ||
                       (r = sshbuf_put_u32(b, originator_port)) != 0 ||
                       (r = sshbuf_put_stringb(&c->output, b)) != 0) {
                           error("%s: compose for muxclient %s", __func__,
                               ssh_err(r));
                           goto out;
                   }
           }
   
    out:
           sshbuf_free(b);
         free(originator_address);          free(originator_address);
         free(listen_address);          free(listen_address);
         return c;          return c;
Line 2039 
Line 2067 
             ctype, rchan, rwindow, rmaxpack);              ctype, rchan, rwindow, rmaxpack);
   
         if (strcmp(ctype, "forwarded-tcpip") == 0) {          if (strcmp(ctype, "forwarded-tcpip") == 0) {
                 c = client_request_forwarded_tcpip(ctype, rchan);                  c = client_request_forwarded_tcpip(ctype, rchan, rwindow,
                       rmaxpack);
         } else if (strcmp(ctype, "forwarded-streamlocal@openssh.com") == 0) {          } else if (strcmp(ctype, "forwarded-streamlocal@openssh.com") == 0) {
                 c = client_request_forwarded_streamlocal(ctype, rchan);                  c = client_request_forwarded_streamlocal(ctype, rchan);
         } else if (strcmp(ctype, "x11") == 0) {          } else if (strcmp(ctype, "x11") == 0) {
Line 2047 
Line 2076 
         } else if (strcmp(ctype, "auth-agent@openssh.com") == 0) {          } else if (strcmp(ctype, "auth-agent@openssh.com") == 0) {
                 c = client_request_agent(ctype, rchan);                  c = client_request_agent(ctype, rchan);
         }          }
 /* XXX duplicate : */          if (c != NULL && c->type == SSH_CHANNEL_MUX_CLIENT) {
         if (c != NULL) {                  debug3("proxied to downstream: %s", ctype);
           } else if (c != NULL) {
                 debug("confirm %s", ctype);                  debug("confirm %s", ctype);
                 c->remote_id = rchan;                  c->remote_id = rchan;
                 c->remote_window = rwindow;                  c->remote_window = rwindow;
Line 2084 
Line 2114 
         char *rtype;          char *rtype;
   
         id = packet_get_int();          id = packet_get_int();
           c = channel_lookup(id);
           if (channel_proxy_upstream(c, type, seq, ctxt))
                   return 0;
         rtype = packet_get_string(NULL);          rtype = packet_get_string(NULL);
         reply = packet_get_char();          reply = packet_get_char();
   
Line 2092 
Line 2125 
   
         if (id == -1) {          if (id == -1) {
                 error("client_input_channel_req: request for channel -1");                  error("client_input_channel_req: request for channel -1");
         } else if ((c = channel_lookup(id)) == NULL) {          } else if (c == NULL) {
                 error("client_input_channel_req: channel %d: "                  error("client_input_channel_req: channel %d: "
                     "unknown channel", id);                      "unknown channel", id);
         } else if (strcmp(rtype, "eow@openssh.com") == 0) {          } else if (strcmp(rtype, "eow@openssh.com") == 0) {

Legend:
Removed from v.1.288  
changed lines
  Added in v.1.289