From 067917ee35b743395e9370cf4d999eb81f7b13c5 Mon Sep 17 00:00:00 2001 From: venkatanadhan gururaghavendran Date: Thu, 25 Jan 2024 16:03:55 +0530 Subject: [PATCH] DLPX-88615 SSHJ - Bad packet received by server when hearbeat is enabled --- src/main/java/net/schmizz/sshj/transport/TransportImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/schmizz/sshj/transport/TransportImpl.java b/src/main/java/net/schmizz/sshj/transport/TransportImpl.java index 58107c5b..69632fc1 100644 --- a/src/main/java/net/schmizz/sshj/transport/TransportImpl.java +++ b/src/main/java/net/schmizz/sshj/transport/TransportImpl.java @@ -420,9 +420,9 @@ public long write(SSHPacket payload) try { if (kexer.isKexOngoing()) { - // Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST + // Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST and IGNORE final Message m = Message.fromByte(payload.array()[payload.rpos()]); - if (!m.in(1, 49) || m == Message.SERVICE_REQUEST) { + if (!m.in(1, 49) || m == Message.SERVICE_REQUEST || m == Message.IGNORE) { assert m != Message.KEXINIT; kexer.waitForDone(); }