Commit 5b365a37 authored by aligungr's avatar aligungr

Request Type IE handling improvement

parent 797e78e0
...@@ -632,7 +632,6 @@ enum class ERequestType ...@@ -632,7 +632,6 @@ enum class ERequestType
INITIAL_EMERGENCY_REQUEST = 0b011, INITIAL_EMERGENCY_REQUEST = 0b011,
EXISTING_EMERGENCY_PDU_SESSION = 0b100, EXISTING_EMERGENCY_PDU_SESSION = 0b100,
MODIFICATION_REQUEST = 0b101, MODIFICATION_REQUEST = 0b101,
RESERVED=0b111,
}; };
enum class EAllowedType enum class EAllowedType
......
...@@ -46,6 +46,13 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg) ...@@ -46,6 +46,13 @@ void NasMm::receiveDlNasTransport(const nas::DlNasTransport &msg)
return; return;
} }
if (msg.payloadContainer.data.length() == 0)
{
m_logger->err("Empty payload container received with type[%d]",
(int)msg.payloadContainerType.payloadContainerType);
return;
}
OctetView buff{msg.payloadContainer.data.data(), static_cast<size_t>(msg.payloadContainer.data.length())}; OctetView buff{msg.payloadContainer.data.data(), static_cast<size_t>(msg.payloadContainer.data.length())};
auto nasMessage = nas::DecodeNasMessage(buff); auto nasMessage = nas::DecodeNasMessage(buff);
...@@ -131,7 +138,8 @@ EProcRc NasMm::deliverUlTransport(const nas::UlNasTransport &msg, ENasTransportH ...@@ -131,7 +138,8 @@ EProcRc NasMm::deliverUlTransport(const nas::UlNasTransport &msg, ENasTransportH
} }
// Perform UAC for PDU session establishment and modification // Perform UAC for PDU session establishment and modification
if (hint == ENasTransportHint::PDU_SESSION_ESTABLISHMENT_REQUEST || hint == ENasTransportHint::PDU_SESSION_MODIFICATION_REQUEST) if (hint == ENasTransportHint::PDU_SESSION_ESTABLISHMENT_REQUEST ||
hint == ENasTransportHint::PDU_SESSION_MODIFICATION_REQUEST)
{ {
if (performUac() != EUacResult::ALLOWED) if (performUac() != EUacResult::ALLOWED)
{ {
......
...@@ -66,12 +66,13 @@ void NasSm::sendSmMessage(int psi, const nas::SmMessage &msg) ...@@ -66,12 +66,13 @@ void NasSm::sendSmMessage(int psi, const nas::SmMessage &msg)
nas::EncodeNasMessage(msg, m.payloadContainer.data); nas::EncodeNasMessage(msg, m.payloadContainer.data);
m.pduSessionId = nas::IEPduSessionIdentity2{}; m.pduSessionId = nas::IEPduSessionIdentity2{};
m.pduSessionId->value = psi; m.pduSessionId->value = psi;
if (msg.messageType == nas::EMessageType::PDU_SESSION_ESTABLISHMENT_REQUEST ||
msg.messageType == nas::EMessageType::PDU_SESSION_MODIFICATION_REQUEST)
{
m.requestType = nas::IERequestType{}; m.requestType = nas::IERequestType{};
m.requestType->requestType = m.requestType->requestType =
session->isEmergency ? nas::ERequestType::INITIAL_EMERGENCY_REQUEST : nas::ERequestType::INITIAL_REQUEST; session->isEmergency ? nas::ERequestType::INITIAL_EMERGENCY_REQUEST : nas::ERequestType::INITIAL_REQUEST;
if (msg.messageType == nas::EMessageType::PDU_SESSION_RELEASE_REQUEST || msg.messageType == nas::EMessageType::PDU_SESSION_RELEASE_COMPLETE) {
m.requestType->requestType = nas::ERequestType::RESERVED;
} }
if (!session->isEmergency) if (!session->isEmergency)
......
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