[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.362 and 1.363

version 1.362, 2017/05/30 08:49:58 version 1.363, 2017/05/30 14:23:52
Line 2367 
Line 2367 
  * replaces local (proxy) channel ID with downstream channel ID.   * replaces local (proxy) channel ID with downstream channel ID.
  */   */
 int  int
 channel_proxy_upstream(Channel *c, int type, u_int32_t seq, void *ctxt)  channel_proxy_upstream(Channel *c, int type, u_int32_t seq, struct ssh *ssh)
 {  {
         struct ssh *ssh = active_state;  
         struct sshbuf *b = NULL;          struct sshbuf *b = NULL;
         Channel *downstream;          Channel *downstream;
         const u_char *cp = NULL;          const u_char *cp = NULL;
Line 2449 
Line 2448 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_data(int type, u_int32_t seq, void *ctxt)  channel_input_data(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         int id;          int id;
         const u_char *data;          const u_char *data;
Line 2461 
Line 2460 
         c = channel_lookup(id);          c = channel_lookup(id);
         if (c == NULL)          if (c == NULL)
                 packet_disconnect("Received data for nonexistent channel %d.", id);                  packet_disconnect("Received data for nonexistent channel %d.", id);
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
   
         /* Ignore any data for non-open channels (might happen on close) */          /* Ignore any data for non-open channels (might happen on close) */
Line 2509 
Line 2508 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_extended_data(int type, u_int32_t seq, void *ctxt)  channel_input_extended_data(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         int id;          int id;
         char *data;          char *data;
Line 2522 
Line 2521 
   
         if (c == NULL)          if (c == NULL)
                 packet_disconnect("Received extended_data for bad channel %d.", id);                  packet_disconnect("Received extended_data for bad channel %d.", id);
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         if (c->type != SSH_CHANNEL_OPEN) {          if (c->type != SSH_CHANNEL_OPEN) {
                 logit("channel %d: ext data for non open", id);                  logit("channel %d: ext data for non open", id);
Line 2559 
Line 2558 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_ieof(int type, u_int32_t seq, void *ctxt)  channel_input_ieof(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         int id;          int id;
         Channel *c;          Channel *c;
Line 2569 
Line 2568 
         c = channel_lookup(id);          c = channel_lookup(id);
         if (c == NULL)          if (c == NULL)
                 packet_disconnect("Received ieof for nonexistent channel %d.", id);                  packet_disconnect("Received ieof for nonexistent channel %d.", id);
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         chan_rcvd_ieof(c);          chan_rcvd_ieof(c);
   
Line 2585 
Line 2584 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_oclose(int type, u_int32_t seq, void *ctxt)  channel_input_oclose(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         int id = packet_get_int();          int id = packet_get_int();
         Channel *c = channel_lookup(id);          Channel *c = channel_lookup(id);
   
         if (c == NULL)          if (c == NULL)
                 packet_disconnect("Received oclose for nonexistent channel %d.", id);                  packet_disconnect("Received oclose for nonexistent channel %d.", id);
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         packet_check_eom();          packet_check_eom();
         chan_rcvd_oclose(c);          chan_rcvd_oclose(c);
Line 2601 
Line 2600 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)  channel_input_open_confirmation(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         int id, remote_id;          int id, remote_id;
         Channel *c;          Channel *c;
Line 2612 
Line 2611 
         if (c==NULL)          if (c==NULL)
                 packet_disconnect("Received open confirmation for "                  packet_disconnect("Received open confirmation for "
                     "unknown channel %d.", id);                      "unknown channel %d.", id);
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         if (c->type != SSH_CHANNEL_OPENING)          if (c->type != SSH_CHANNEL_OPENING)
                 packet_disconnect("Received open confirmation for "                  packet_disconnect("Received open confirmation for "
Line 2653 
Line 2652 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_open_failure(int type, u_int32_t seq, void *ctxt)  channel_input_open_failure(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         int id, reason;          int id, reason;
         char *msg = NULL, *lang = NULL;          char *msg = NULL, *lang = NULL;
Line 2665 
Line 2664 
         if (c==NULL)          if (c==NULL)
                 packet_disconnect("Received open failure for "                  packet_disconnect("Received open failure for "
                     "unknown channel %d.", id);                      "unknown channel %d.", id);
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         if (c->type != SSH_CHANNEL_OPENING)          if (c->type != SSH_CHANNEL_OPENING)
                 packet_disconnect("Received open failure for "                  packet_disconnect("Received open failure for "
Line 2692 
Line 2691 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)  channel_input_window_adjust(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         Channel *c;          Channel *c;
         int id;          int id;
Line 2706 
Line 2705 
                 logit("Received window adjust for non-open channel %d.", id);                  logit("Received window adjust for non-open channel %d.", id);
                 return 0;                  return 0;
         }          }
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         adjust = packet_get_int();          adjust = packet_get_int();
         packet_check_eom();          packet_check_eom();
Line 2720 
Line 2719 
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 channel_input_status_confirm(int type, u_int32_t seq, void *ctxt)  channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh)
 {  {
         Channel *c;          Channel *c;
         struct channel_confirm *cc;          struct channel_confirm *cc;
Line 2736 
Line 2735 
                 logit("channel_input_status_confirm: %d: unknown", id);                  logit("channel_input_status_confirm: %d: unknown", id);
                 return 0;                  return 0;
         }          }
         if (channel_proxy_upstream(c, type, seq, ctxt))          if (channel_proxy_upstream(c, type, seq, ssh))
                 return 0;                  return 0;
         packet_check_eom();          packet_check_eom();
         if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL)          if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL)

Legend:
Removed from v.1.362  
changed lines
  Added in v.1.363