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

Diff for /src/usr.bin/ssh/packet.c between version 1.109 and 1.109.2.1

version 1.109, 2003/07/10 14:42:28 version 1.109.2.1, 2004/02/28 03:51:33
Line 165 
Line 165 
                 buffer_init(&incoming_packet);                  buffer_init(&incoming_packet);
                 TAILQ_INIT(&outgoing);                  TAILQ_INIT(&outgoing);
         }          }
         /* Kludge: arrange the close function to be called from fatal(). */  
         fatal_add_cleanup((void (*) (void *)) packet_close, NULL);  
 }  }
   
 /* Returns 1 if remote host is connected via socket, 0 if not. */  /* Returns 1 if remote host is connected via socket, 0 if not. */
Line 865 
Line 863 
                 len = read(connection_in, buf, sizeof(buf));                  len = read(connection_in, buf, sizeof(buf));
                 if (len == 0) {                  if (len == 0) {
                         logit("Connection closed by %.200s", get_remote_ipaddr());                          logit("Connection closed by %.200s", get_remote_ipaddr());
                         fatal_cleanup();                          cleanup_exit(255);
                 }                  }
                 if (len < 0)                  if (len < 0)
                         fatal("Read from socket failed: %.100s", strerror(errno));                          fatal("Read from socket failed: %.100s", strerror(errno));
Line 1015 
Line 1013 
                 cp = buffer_ptr(&incoming_packet);                  cp = buffer_ptr(&incoming_packet);
                 packet_length = GET_32BIT(cp);                  packet_length = GET_32BIT(cp);
                 if (packet_length < 1 + 4 || packet_length > 256 * 1024) {                  if (packet_length < 1 + 4 || packet_length > 256 * 1024) {
   #ifdef PACKET_DEBUG
                         buffer_dump(&incoming_packet);                          buffer_dump(&incoming_packet);
   #endif
                         packet_disconnect("Bad packet length %u.", packet_length);                          packet_disconnect("Bad packet length %u.", packet_length);
                 }                  }
                 DBG(debug("input: packet len %u", packet_length+4));                  DBG(debug("input: packet len %u", packet_length+4));
Line 1129 
Line 1129 
                                 logit("Received disconnect from %s: %u: %.400s",                                  logit("Received disconnect from %s: %u: %.400s",
                                     get_remote_ipaddr(), reason, msg);                                      get_remote_ipaddr(), reason, msg);
                                 xfree(msg);                                  xfree(msg);
                                 fatal_cleanup();                                  cleanup_exit(255);
                                 break;                                  break;
                         case SSH2_MSG_UNIMPLEMENTED:                          case SSH2_MSG_UNIMPLEMENTED:
                                 seqnr = packet_get_int();                                  seqnr = packet_get_int();
Line 1154 
Line 1154 
                                 msg = packet_get_string(NULL);                                  msg = packet_get_string(NULL);
                                 logit("Received disconnect from %s: %.400s",                                  logit("Received disconnect from %s: %.400s",
                                     get_remote_ipaddr(), msg);                                      get_remote_ipaddr(), msg);
                                 fatal_cleanup();                                  cleanup_exit(255);
                                 xfree(msg);                                  xfree(msg);
                                 break;                                  break;
                         default:                          default:
Line 1331 
Line 1331 
   
         /* Close the connection. */          /* Close the connection. */
         packet_close();          packet_close();
           cleanup_exit(255);
         fatal_cleanup();  
 }  }
   
 /* Checks if there is any buffered output, and tries to write some of the output. */  /* Checks if there is any buffered output, and tries to write some of the output. */

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.109.2.1