Commit 04deb94d authored by Tien Thinh NGUYEN's avatar Tien Thinh NGUYEN

Fix issue for encoding NSSAI

parent 81261861
...@@ -4065,6 +4065,8 @@ void amf_n1::initialize_registration_accept( ...@@ -4065,6 +4065,8 @@ void amf_n1::initialize_registration_accept(
} else { } else {
snssai.length = SST_LENGTH + SD_LENGTH; snssai.length = SST_LENGTH + SD_LENGTH;
} }
Logger::amf_n1().debug(
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)", s.sst, s.sd);
allowed_nssais.push_back(snssai); allowed_nssais.push_back(snssai);
found = true; found = true;
break; break;
......
...@@ -40,10 +40,10 @@ NSSAI::NSSAI(const uint8_t iei, std::vector<struct SNSSAI_s> nssai) { ...@@ -40,10 +40,10 @@ NSSAI::NSSAI(const uint8_t iei, std::vector<struct SNSSAI_s> nssai) {
length = 0; length = 0;
S_NSSAIs.assign(nssai.begin(), nssai.end()); S_NSSAIs.assign(nssai.begin(), nssai.end());
for (int i = 0; i < nssai.size(); i++) { for (int i = 0; i < nssai.size(); i++) {
length += 2; // 1 for IEI and 1 for sst length += (1 + nssai[i].length); // 1 for IEI
if (nssai[i].sd != SD_NO_VALUE) length += SD_LENGTH; // if (nssai[i].sd != SD_NO_VALUE) length += SD_LENGTH;
if (nssai[i].mHplmnSst != -1) length += SST_LENGTH; // if (nssai[i].mHplmnSst != -1) length += SST_LENGTH;
if (nssai[i].mHplmnSd != SD_NO_VALUE) length += SD_LENGTH; // if (nssai[i].mHplmnSd != SD_NO_VALUE) length += SD_LENGTH;
} }
} }
......
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