diff options
author | 2016-01-29 05:46:01 +0000 | |
---|---|---|
committer | 2016-01-29 05:46:01 +0000 | |
commit | b42411ce0dbf8bc2a80e95dc9f7bee046298bbda (patch) | |
tree | c90474c9edde9ae99c97db205aebb77b1b5ec2a8 | |
parent | Add regression test for RekeyLimit parsing of >32bit values (4G and 8G). (diff) | |
download | wireguard-openbsd-b42411ce0dbf8bc2a80e95dc9f7bee046298bbda.tar.xz wireguard-openbsd-b42411ce0dbf8bc2a80e95dc9f7bee046298bbda.zip |
include packet type of non-data packets in debug3 output;
ok markus dtucker
-rw-r--r-- | usr.bin/ssh/packet.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index bcdde494d46..a3b3aae0be7 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.225 2016/01/29 03:31:03 dtucker Exp $ */ +/* $OpenBSD: packet.c,v 1.226 2016/01/29 05:46:01 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1054,6 +1054,20 @@ ssh_packet_enable_delayed_compress(struct ssh *ssh) return 0; } +/* Used to mute debug logging for noisy packet types */ +static int +ssh_packet_log_type(u_char type) +{ + switch (type) { + case SSH2_MSG_CHANNEL_DATA: + case SSH2_MSG_CHANNEL_EXTENDED_DATA: + case SSH2_MSG_CHANNEL_WINDOW_ADJUST: + return 0; + default: + return 1; + } +} + /* * Finalize packet in SSH2 format (compress, mac, encrypt, enqueue) */ @@ -1082,7 +1096,8 @@ ssh_packet_send2_wrapped(struct ssh *ssh) aadlen = (mac && mac->enabled && mac->etm) || authlen ? 4 : 0; type = (sshbuf_ptr(state->outgoing_packet))[5]; - + if (ssh_packet_log_type(type)) + debug3("send packet: type %u", type); #ifdef PACKET_DEBUG fprintf(stderr, "plain: "); sshbuf_dump(state->outgoing_packet, stderr); @@ -1734,6 +1749,8 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) */ if ((r = sshbuf_get_u8(state->incoming_packet, typep)) != 0) goto out; + if (ssh_packet_log_type(*typep)) + debug3("receive packet: type %u", *typep); if (*typep < SSH2_MSG_MIN || *typep >= SSH2_MSG_LOCAL_MIN) { if ((r = sshpkt_disconnect(ssh, "Invalid ssh2 packet type: %d", *typep)) != 0 || |