From 01fbb2d9fd4f052abf81ec53fd1609a2fb38fb64 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 17:06:08 +0100 Subject: [PATCH 1/4] improvements --- mission/devices/HeaterHandler.cpp | 1 + mission/tmtc/CfdpTmFunnel.cpp | 6 ++++++ mission/tmtc/PusTmFunnel.cpp | 6 ++++++ mission/tmtc/VirtualChannel.cpp | 8 +++++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index 9600c0db..1af82604 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -95,6 +95,7 @@ void HeaterHandler::readCommandQueue() { break; } else if (result != returnvalue::OK) { sif::warning << "HeaterHandler::readCommandQueue: Message reception error" << std::endl; + break; } result = actionHelper.handleActionMessage(&command); if (result == returnvalue::OK) { diff --git a/mission/tmtc/CfdpTmFunnel.cpp b/mission/tmtc/CfdpTmFunnel.cpp index f19d5360..50a7b24a 100644 --- a/mission/tmtc/CfdpTmFunnel.cpp +++ b/mission/tmtc/CfdpTmFunnel.cpp @@ -12,6 +12,7 @@ const char* CfdpTmFunnel::getName() const { return "CFDP TM Funnel"; } ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { TmTcMessage currentMessage; + unsigned int count = 0; ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); while (status == returnvalue::OK) { status = handlePacket(currentMessage); @@ -19,6 +20,11 @@ ReturnValue_t CfdpTmFunnel::performOperation(uint8_t) { sif::warning << "CfdpTmFunnel packet handling failed" << std::endl; break; } + count++; + if(count == 500) { + sif::error << "CfdpTmFunnel: Possible message storm detected" << std::endl; + break; + } status = tmQueue->receiveMessage(¤tMessage); } diff --git a/mission/tmtc/PusTmFunnel.cpp b/mission/tmtc/PusTmFunnel.cpp index dda854a6..e239afc9 100644 --- a/mission/tmtc/PusTmFunnel.cpp +++ b/mission/tmtc/PusTmFunnel.cpp @@ -12,6 +12,7 @@ PusTmFunnel::~PusTmFunnel() = default; ReturnValue_t PusTmFunnel::performOperation(uint8_t) { TmTcMessage currentMessage; + unsigned int count = 0; ReturnValue_t status = tmQueue->receiveMessage(¤tMessage); while (status == returnvalue::OK) { status = handlePacket(currentMessage); @@ -19,6 +20,11 @@ ReturnValue_t PusTmFunnel::performOperation(uint8_t) { sif::warning << "TmFunnel packet handling failed" << std::endl; break; } + count++; + if(count == 500) { + sif::error << "PusTmFunnel: Possible message storm detected" << std::endl; + break; + } status = tmQueue->receiveMessage(¤tMessage); } diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index b0f9391d..a33a7dba 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -28,6 +28,7 @@ ReturnValue_t VirtualChannel::performOperation() { ReturnValue_t result = returnvalue::OK; TmTcMessage message; + unsigned int count = 0; while (tmQueue->receiveMessage(&message) == returnvalue::OK) { store_address_t storeId = message.getStorageId(); const uint8_t* data = nullptr; @@ -45,9 +46,10 @@ ReturnValue_t VirtualChannel::performOperation() { } tmStore->deleteData(storeId); - - if (result != returnvalue::OK) { - return result; + count++; + if(count == 500) { + sif::error << "VirtualChannel: Possible message storm detected" << std::endl; + break; } } return result; From 4b6e0addf1ede2d5005605adad89c29022e6c9e0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 17:07:48 +0100 Subject: [PATCH 2/4] changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 891a4d76..0c9a05df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,15 @@ change warranting a new major release: - git post checkout hook which initializes and updates the submodules automatically. +## Fixed + +- Limit number of handled messages for core TM handlers: + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 +- HeaterHandler better handling for faulty message reception + Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 + # [v1.28.0] 2023-02-17 eive-tmtc: v2.12.7 From 9a9574369a36142a2458008e420d2339a2e26d1e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 17:08:55 +0100 Subject: [PATCH 3/4] deleted accidentaly --- mission/tmtc/VirtualChannel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mission/tmtc/VirtualChannel.cpp b/mission/tmtc/VirtualChannel.cpp index a33a7dba..64c7b006 100644 --- a/mission/tmtc/VirtualChannel.cpp +++ b/mission/tmtc/VirtualChannel.cpp @@ -44,8 +44,11 @@ ReturnValue_t VirtualChannel::performOperation() { if (linkIsUp) { result = ptme->writeToVc(vcId, data, size); } - tmStore->deleteData(storeId); + if (result != returnvalue::OK) { + return result; + } + count++; if(count == 500) { sif::error << "VirtualChannel: Possible message storm detected" << std::endl; From 7aa977efdf2e66dbcc0e8b594dee1d237225174d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Feb 2023 11:32:51 +0100 Subject: [PATCH 4/4] move changelog entry --- CHANGELOG.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a230adad..2134fe20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ change warranting a new major release: # [unreleased] +## Fixed + +- Limit number of handled messages for core TM handlers: + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 + - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 +- HeaterHandler better handling for faulty message reception + Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 + # [v1.29.0] eive-tmtc: v2.13.0 @@ -63,15 +72,6 @@ eive-tmtc: v2.13.0 - git post checkout hook which initializes and updates the submodules automatically. -## Fixed - -- Limit number of handled messages for core TM handlers: - - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/391 - - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/390 - - https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/389 -- HeaterHandler better handling for faulty message reception - Issue: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/issues/388 - # [v1.28.0] 2023-02-17 eive-tmtc: v2.12.7