]> andersk Git - openssh.git/blobdiff - packet.c
- stevesk@cvs.openbsd.org 2002/12/04 04:36:47
[openssh.git] / packet.c
index bd347ef0f4ff90a87bc5944c934abd2717c39c37..0a8baa5b208555430c639970ed59c236bece060b 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: packet.c,v 1.97 2002/07/04 08:12:15 deraadt Exp $");
+RCSID("$OpenBSD: packet.c,v 1.100 2002/11/21 22:45:31 markus Exp $");
 
 #include "xmalloc.h"
 #include "buffer.h"
@@ -564,7 +564,7 @@ set_newkeys(int mode)
        CipherContext *cc;
        int encrypt;
 
-       debug("newkeys: mode %d", mode);
+       debug2("set_newkeys: mode %d", mode);
 
        if (mode == MODE_OUT) {
                cc = &send_context;
@@ -574,7 +574,7 @@ set_newkeys(int mode)
                encrypt = CIPHER_DECRYPT;
        }
        if (newkeys[mode] != NULL) {
-               debug("newkeys: rekeying");
+               debug("set_newkeys: rekeying");
                cipher_cleanup(cc);
                enc  = &newkeys[mode]->enc;
                mac  = &newkeys[mode]->mac;
@@ -840,7 +840,7 @@ packet_read_poll1(void)
        cp = buffer_ptr(&input);
        len = GET_32BIT(cp);
        if (len < 1 + 2 + 2 || len > 256 * 1024)
-               packet_disconnect("Bad packet length %d.", len);
+               packet_disconnect("Bad packet length %u.", len);
        padded_len = (len + 8) & ~7;
 
        /* Check if the packet has been entirely received. */
@@ -936,9 +936,9 @@ packet_read_poll2(u_int32_t *seqnr_p)
                packet_length = GET_32BIT(cp);
                if (packet_length < 1 + 4 || packet_length > 256 * 1024) {
                        buffer_dump(&incoming_packet);
-                       packet_disconnect("Bad packet length %d.", packet_length);
+                       packet_disconnect("Bad packet length %u.", packet_length);
                }
-               DBG(debug("input: packet len %d", packet_length+4));
+               DBG(debug("input: packet len %u", packet_length+4));
                buffer_consume(&input, block_size);
        }
        /* we have a partial packet of block_size bytes */
@@ -1226,6 +1226,9 @@ packet_disconnect(const char *fmt,...)
        vsnprintf(buf, sizeof(buf), fmt, args);
        va_end(args);
 
+       /* Display the error locally */
+       log("Disconnecting: %.100s", buf);
+
        /* Send the disconnect message to the other side, and wait for it to get sent. */
        if (compat20) {
                packet_start(SSH2_MSG_DISCONNECT);
@@ -1245,8 +1248,6 @@ packet_disconnect(const char *fmt,...)
        /* Close the connection. */
        packet_close();
 
-       /* Display the error locally and exit. */
-       log("Disconnecting: %.100s", buf);
        fatal_cleanup();
 }
 
This page took 0.032631 seconds and 4 git commands to generate.