Commit 77a533d3 authored by Stefan Spettel's avatar Stefan Spettel

fix(smf): SUPI without trailing zero delimiter to PCF

Signed-off-by: default avatarStefan Spettel <stefan.spettel@eurecom.fr>
parent 3ae9dafc
......@@ -54,6 +54,18 @@ static std::string smf_supi_to_string(supi_t const supi) {
return supi_str;
}
// TODO should we just replace the other function? Because this null chars are
// annoying
static std::string smf_supi_to_string_without_nulls(supi_t const supi) {
std::string supi_str;
for (char c : supi.data) {
if (c != '\u0000') {
supi_str += c;
}
}
return supi_str;
}
static uint64_t smf_supi_to_u64(supi_t supi) {
uint64_t uint_supi;
sscanf(supi.data, "%" SCNu64, &uint_supi);
......
......@@ -1512,8 +1512,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
sp.get()->policy_ptr = std::make_shared<n7::policy_association>();
bool use_pcf_policy = false;
sp.get()->policy_ptr->set_context(
smf_supi_to_string(smreq->req.get_supi()), smreq->req.get_dnn(), snssai,
plmn, smreq->req.get_pdu_session_id(), smreq->req.get_pdu_session_type());
smf_supi_to_string_without_nulls(smreq->req.get_supi()),
smreq->req.get_dnn(), snssai, plmn, smreq->req.get_pdu_session_id(),
smreq->req.get_pdu_session_type());
// TODO what is the exact meaning of SCID? Is this unique per registration
// or unique per PDU session?
......
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