Commit deba3ae0 authored by Robert Schmidt's avatar Robert Schmidt

Reset CU-UP E1 UE contexts after E1 Setup Response

38.463 sec. 8.2.3 says

> This procedure also re-initialises the E1AP UE-related contexts (if
> any) and erases all related signalling connections in the two nodes like
> a Reset procedure would do.

Hence, delete all contexts after reception of E1 Setup Response. This
minimizes a risk of receiving an E1 bearer setup req for an existing UE,
which currently leads to an assert [we trust the CU-CP does not send the
same UE ID twice, as we only "mirror" the existing UE ID].
parent b9acf4a8
......@@ -219,6 +219,8 @@ int e1apCUUP_handle_SETUP_RESPONSE(sctp_assoc_t assoc_id, e1ap_upcp_inst_t *inst
return -1;
}
free_e1ap_cuup_setup_response(&out);
e1_reset(); // reset all UE contexts, if any: see 38.463 sec 8.2.3
return 0;
}
......
......@@ -330,3 +330,15 @@ void e1_bearer_release_cmd(const e1ap_bearer_release_cmd_t *cmd)
get_e1_if()->bearer_release_complete(&cplt);
}
void e1_reset(void)
{
/* we get the list of all UEs from the PDCP, which maintains a list */
ue_id_t ue_ids[MAX_MOBILES_PER_GNB];
int num = nr_pdcp_get_num_ues(ue_ids, MAX_MOBILES_PER_GNB);
for (uint32_t i = 0; i < num; ++i) {
ue_id_t ue_id = ue_ids[i];
LOG_W(E1AP, "releasing UE %ld\n", ue_id);
remove_ue_e1(ue_id);
}
}
......@@ -31,5 +31,6 @@ struct e1ap_bearer_release_cmd_s;
void e1_bearer_context_setup(const struct e1ap_bearer_setup_req_s *req);
void e1_bearer_context_modif(const struct e1ap_bearer_setup_req_s *req);
void e1_bearer_release_cmd(const struct e1ap_bearer_release_cmd_s *cmd);
void e1_reset(void);
#endif /* CUCP_CUUP_HANDLER_H */
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