[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.279 and 1.280

version 1.279, 2019/01/04 03:23:00 version 1.280, 2019/01/19 21:33:14
Line 1785 
Line 1785 
 /*  /*
  * Pretty-print connection-terminating errors and exit.   * Pretty-print connection-terminating errors and exit.
  */   */
 void  static void
 sshpkt_fatal(struct ssh *ssh, const char *tag, int r)  sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap)
 {  {
         char remote_id[512];          char *tag = NULL, remote_id[512];
   
         sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id));          sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id));
   
Line 1822 
Line 1822 
                 }                  }
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         default:          default:
                   if (vasprintf(&tag, fmt, ap) == -1) {
                           ssh_packet_clear_keys(ssh);
                           logdie("%s: could not allocate failure message",
                               __func__);
                   }
                 ssh_packet_clear_keys(ssh);                  ssh_packet_clear_keys(ssh);
                 logdie("%s%sConnection %s %s: %s",                  logdie("%s%sConnection %s %s: %s",
                     tag != NULL ? tag : "", tag != NULL ? ": " : "",                      tag != NULL ? tag : "", tag != NULL ? ": " : "",
Line 1830 
Line 1835 
         }          }
 }  }
   
   void
   sshpkt_fatal(struct ssh *ssh, int r, const char *fmt, ...)
   {
           va_list ap;
   
           va_start(ap, fmt);
           sshpkt_vfatal(ssh, r, fmt, ap);
           /* NOTREACHED */
           va_end(ap);
           logdie("%s: should have exited", __func__);
   }
   
 /*  /*
  * Logs the error plus constructs and sends a disconnect packet, closes the   * Logs the error plus constructs and sends a disconnect packet, closes the
  * connection, and exits.  This function never returns. The error message   * connection, and exits.  This function never returns. The error message
Line 1865 
Line 1882 
          * for it to get sent.           * for it to get sent.
          */           */
         if ((r = sshpkt_disconnect(ssh, "%s", buf)) != 0)          if ((r = sshpkt_disconnect(ssh, "%s", buf)) != 0)
                 sshpkt_fatal(ssh, __func__, r);                  sshpkt_fatal(ssh, r, "%s", __func__);
   
         if ((r = ssh_packet_write_wait(ssh)) != 0)          if ((r = ssh_packet_write_wait(ssh)) != 0)
                 sshpkt_fatal(ssh, __func__, r);                  sshpkt_fatal(ssh, r, "%s", __func__);
   
         /* Close the connection. */          /* Close the connection. */
         ssh_packet_close(ssh);          ssh_packet_close(ssh);

Legend:
Removed from v.1.279  
changed lines
  Added in v.1.280