From 1182cd177155d639368038cf0cb3cb4541cdb7ff Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Thu, 15 Feb 2024 20:32:54 +0000 Subject: [PATCH] - MMS client: avoid invoke ID 0 as it is used as return value of client function in case of an error --- src/mms/iso_mms/client/mms_client_connection.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mms/iso_mms/client/mms_client_connection.c b/src/mms/iso_mms/client/mms_client_connection.c index 6f743b0b..0ba12801 100644 --- a/src/mms/iso_mms/client/mms_client_connection.c +++ b/src/mms/iso_mms/client/mms_client_connection.c @@ -1,7 +1,7 @@ /* * mms_client_connection.c * - * Copyright 2013-2022 Michael Zillgith + * Copyright 2013-2024 Michael Zillgith * * This file is part of libIEC61850. * @@ -242,6 +242,10 @@ getNextInvokeId(MmsConnection self) Semaphore_wait(self->nextInvokeIdLock); self->nextInvokeId++; + + if (self->nextInvokeId == 0) + self->nextInvokeId = 1; + nextInvokeId = self->nextInvokeId; Semaphore_post(self->nextInvokeIdLock);