Commit 7807ba9a authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for decoding PDU Session Status

parent 7b3664cf
...@@ -626,7 +626,7 @@ void amf_n1::service_request_handle( ...@@ -626,7 +626,7 @@ void amf_n1::service_request_handle(
nullptr, (uint8_t*) bdata(plain_msg), blength(plain_msg)); nullptr, (uint8_t*) bdata(plain_msg), blength(plain_msg));
bdestroy(plain_msg); bdestroy(plain_msg);
if (serReqNas->getPduSessionStatus() > 0) { if (serReqNas->getPduSessionStatus() > 0) {
pdu_session_status = serReqNas->getPduSessionStatus(); pdu_session_status = (uint16_t) serReqNas->getPduSessionStatus();
} }
} break; } break;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "PDU_Session_Status.hpp" #include "PDU_Session_Status.hpp"
#include "logger.hpp" #include "logger.hpp"
#include "common_defs.h"
using namespace nas; using namespace nas;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -98,14 +99,12 @@ int PDU_Session_Status::decodefrombuffer( ...@@ -98,14 +99,12 @@ int PDU_Session_Status::decodefrombuffer(
if (is_option) { if (is_option) {
decoded_size++; decoded_size++;
} }
_value = 0x0000; _value = 0x0000;
length = *(buf + decoded_size); length = *(buf + decoded_size);
decoded_size++; decoded_size++;
_value |= *(buf + decoded_size); DECODE_U16(buf + decoded_size, _value, decoded_size);
decoded_size++; Logger::nas_mm().debug("decoded PDU_Session_Status value (0x%x)", _value);
_value |= (*(buf + decoded_size)) << 8;
decoded_size++;
Logger::nas_mm().debug("decoded PDU_Session_Status value(0x%4x)", _value);
Logger::nas_mm().debug("decoded PDU_Session_Status len(%d)", decoded_size); Logger::nas_mm().debug("decoded PDU_Session_Status len(%d)", decoded_size);
return decoded_size; return decoded_size;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment