[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.164 and 1.165

version 1.164, 2009/06/12 20:43:22 version 1.165, 2009/06/12 20:58:32
Line 178 
Line 178 
         /* Used in packet_read_poll2() */          /* Used in packet_read_poll2() */
         u_int packlen;          u_int packlen;
   
           /* Used in packet_send2 */
           int rekeying;
   
           /* Used in packet_set_interactive */
           int set_interactive_called;
   
           /* Used in packet_set_maxsize */
           int set_maxsize_called;
   
         TAILQ_HEAD(, packet) outgoing;          TAILQ_HEAD(, packet) outgoing;
 };  };
   
Line 941 
Line 950 
 static void  static void
 packet_send2(void)  packet_send2(void)
 {  {
         static int rekeying = 0;  
         struct packet *p;          struct packet *p;
         u_char type, *cp;          u_char type, *cp;
   
Line 949 
Line 957 
         type = cp[5];          type = cp[5];
   
         /* during rekeying we can only send key exchange messages */          /* during rekeying we can only send key exchange messages */
         if (rekeying) {          if (active_state->rekeying) {
                 if (!((type >= SSH2_MSG_TRANSPORT_MIN) &&                  if (!((type >= SSH2_MSG_TRANSPORT_MIN) &&
                     (type <= SSH2_MSG_TRANSPORT_MAX))) {                      (type <= SSH2_MSG_TRANSPORT_MAX))) {
                         debug("enqueue packet: %u", type);                          debug("enqueue packet: %u", type);
Line 965 
Line 973 
   
         /* rekeying starts with sending KEXINIT */          /* rekeying starts with sending KEXINIT */
         if (type == SSH2_MSG_KEXINIT)          if (type == SSH2_MSG_KEXINIT)
                 rekeying = 1;                  active_state->rekeying = 1;
   
         packet_send2_wrapped();          packet_send2_wrapped();
   
         /* after a NEWKEYS message we can send the complete queue */          /* after a NEWKEYS message we can send the complete queue */
         if (type == SSH2_MSG_NEWKEYS) {          if (type == SSH2_MSG_NEWKEYS) {
                 rekeying = 0;                  active_state->rekeying = 0;
                 while ((p = TAILQ_FIRST(&active_state->outgoing))) {                  while ((p = TAILQ_FIRST(&active_state->outgoing))) {
                         type = p->type;                          type = p->type;
                         debug("dequeue packet: %u", type);                          debug("dequeue packet: %u", type);
Line 1726 
Line 1734 
 void  void
 packet_set_interactive(int interactive)  packet_set_interactive(int interactive)
 {  {
         static int called = 0;          if (active_state->set_interactive_called)
   
         if (called)  
                 return;                  return;
         called = 1;          active_state->set_interactive_called = 1;
   
         /* Record that we are in interactive mode. */          /* Record that we are in interactive mode. */
         active_state->interactive_mode = interactive;          active_state->interactive_mode = interactive;
Line 1753 
Line 1759 
 int  int
 packet_set_maxsize(u_int s)  packet_set_maxsize(u_int s)
 {  {
         static int called = 0;          if (active_state->set_maxsize_called) {
   
         if (called) {  
                 logit("packet_set_maxsize: called twice: old %d new %d",                  logit("packet_set_maxsize: called twice: old %d new %d",
                     active_state->max_packet_size, s);                      active_state->max_packet_size, s);
                 return -1;                  return -1;
Line 1764 
Line 1768 
                 logit("packet_set_maxsize: bad size %d", s);                  logit("packet_set_maxsize: bad size %d", s);
                 return -1;                  return -1;
         }          }
         called = 1;          active_state->set_maxsize_called = 1;
         debug("packet_set_maxsize: setting to %d", s);          debug("packet_set_maxsize: setting to %d", s);
         active_state->max_packet_size = s;          active_state->max_packet_size = s;
         return s;          return s;

Legend:
Removed from v.1.164  
changed lines
  Added in v.1.165