From e21fa7efe8d00fd28900b436dd90f43519314843 Mon Sep 17 00:00:00 2001 From: bmalinowsky Date: Mon, 27 Jan 2025 22:30:13 +0100 Subject: [PATCH] Don't prematurely increment send seq on ack error (fixes #146) --- src/io/calimero/knxnetip/ClientConnection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/io/calimero/knxnetip/ClientConnection.java b/src/io/calimero/knxnetip/ClientConnection.java index ee66e4c8..f65083fc 100644 --- a/src/io/calimero/knxnetip/ClientConnection.java +++ b/src/io/calimero/knxnetip/ClientConnection.java @@ -1,6 +1,6 @@ /* Calimero 2 - A library for KNX network access - Copyright (c) 2010, 2024 B. Malinowsky + Copyright (c) 2010, 2025 B. Malinowsky This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -418,7 +418,8 @@ else if (svc == serviceAck) { else { if (!checkVersion(h)) return true; - incSeqSend(); + if (res.getStatus() == ErrorCodes.NO_ERROR) + incSeqSend(); // update state and notify our lock setStateNotify(res.getStatus() == ErrorCodes.NO_ERROR ? CEMI_CON_PENDING : ACK_ERROR); logger.log(TRACE, "received service ack {0} from {1} (channel {2})",