diff options
author | Ben V. Brown <Ralim@Ralimtek.com> | 2022-06-23 15:12:11 +0300 |
---|---|---|
committer | Ben V. Brown <Ralim@Ralimtek.com> | 2022-06-23 15:12:11 +0300 |
commit | fcb9e6a493fa51ccaeaead5775878f99da55579e (patch) | |
tree | db4d5a90315d3f1ba084f57677b794c4753237e4 | |
parent | 5e7ed6c3851601980879344b5f0af37497dd7125 (diff) |
Correct chunk reassembly
-rw-r--r-- | src/policy_engine_states.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/policy_engine_states.cpp b/src/policy_engine_states.cpp index c3a5680..e8e7ea5 100644 --- a/src/policy_engine_states.cpp +++ b/src/policy_engine_states.cpp @@ -484,9 +484,9 @@ PolicyEngine::policy_engine_state PolicyEngine::pe_sink_handle_epr_chunk() { // Copy first message directly over the object to set header,ext-header + start of PDO's memcpy(&this->recent_epr_capabilities, &tempMessage.bytes, sizeof(tempMessage.bytes)); } else { - memcpy(&(this->recent_epr_capabilities.data[chunk_index * (6 * 4)]), &tempMessage.data, (4 * (PD_NUMOBJ_GET(&tempMessage) - 1))); + memcpy(&(this->recent_epr_capabilities.data[chunk_index * (7 * 4)]), &tempMessage.data, (4 * (PD_NUMOBJ_GET(&tempMessage) - 1))); } - const auto recievedLength = (PD_MAX_EXT_MSG_CHUNK_LEN * chunk_index) /*Bytes Implicit by chunk index*/ + 2 /*Ext Header*/ + (4 * (PD_NUMOBJ_GET(&tempMessage) - 1) /* Data in this message*/); + const auto recievedLength = ((7 * 4) * chunk_index) /*Bytes Implicit by chunk index*/ + (4 * (PD_NUMOBJ_GET(&tempMessage) - 1) /* Data in this message*/); for (int i = 0; i < 11; i++) { } |