Commit 4e71068d authored by aligungr's avatar aligungr

PDU session establishment accept improvement

parent d8f12f66
......@@ -369,7 +369,7 @@ std::unique_ptr<NasMessage> DecodeNasMessage(const OctetView &stream)
}
else
{
auto pduSessionId = static_cast<EPduSessionIdentity>(stream.readI());
auto pduSessionId = stream.readI();
uint8_t pti = stream.read();
auto messageType = static_cast<EMessageType>(stream.readI());
......
......@@ -87,8 +87,8 @@ struct NasMessage
struct SmMessage : NasMessage
{
EPduSessionIdentity pduSessionId{};
uint8_t pti{};
int pduSessionId{};
int pti{};
EMessageType messageType{};
protected:
......
......@@ -105,7 +105,7 @@ void NasSm::sendEstablishmentRequest(const SessionConfig &config)
/* Prepare the establishment request message */
auto req = std::make_unique<nas::PduSessionEstablishmentRequest>();
req->pti = pti;
req->pduSessionId = static_cast<nas::EPduSessionIdentity>(psi);
req->pduSessionId = psi;
req->integrityProtectionMaximumDataRate = MakeIntegrityMaxRate(m_base->config->integrityMaxRate);
req->pduSessionType = nas::IEPduSessionType{};
req->pduSessionType->pduSessionType = nas::EPduSessionType::IPV4;
......@@ -127,15 +127,33 @@ void NasSm::sendEstablishmentRequest(const SessionConfig &config)
void NasSm::receivePduSessionEstablishmentAccept(const nas::PduSessionEstablishmentAccept &msg)
{
m_logger->debug("PDU Session Establishment Accept received");
if (msg.smCause.has_value())
{
m_logger->warn("SM cause received in PduSessionEstablishmentAccept [%s]",
nas::utils::EnumToString(msg.smCause->value));
}
if (msg.pti < ProcedureTransaction::MIN_ID || msg.pti > ProcedureTransaction::MAX_ID)
{
// PTI is required for PDU session establishment request
m_logger->err("Received PTI [%d] value is invalid", msg.pti);
sendSmCause(nas::ESmCause::INVALID_PTI_VALUE, msg.pduSessionId);
return;
}
if (m_procedureTransactions[msg.pti].psi != msg.pduSessionId)
{
m_logger->err("Received PSI value [%d] is invalid, expected was [%d]", msg.pduSessionId,
m_procedureTransactions[msg.pti].psi);
sendSmCause(nas::ESmCause::INVALID_PTI_VALUE, msg.pduSessionId);
return;
}
freeProcedureTransactionId(msg.pti);
auto pduSession = m_pduSessions[static_cast<int>(msg.pduSessionId)];
auto& pduSession = m_pduSessions[msg.pduSessionId];
if (pduSession->psState != EPsState::ACTIVE_PENDING)
{
m_logger->err("PS establishment accept received without requested");
......
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