Commit 1363a53d authored by Robert Schmidt's avatar Robert Schmidt

S1AP: Only register MME if we do not know it yet

parent b01d63ba
......@@ -220,8 +220,21 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
/* Trying to connect to provided list of MME ip address */
for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
net_ip_address_t *mme_ip = &s1ap_register_eNB->mme_ip_address[index];
struct s1ap_eNB_mme_data_s *mme = NULL;
RB_FOREACH(mme, s1ap_mme_map, &new_instance->s1ap_mme_head) {
/* Compare whether IPv4 and IPv6 information is already present, in which
* wase we do not register again */
if (mme->mme_s1_ip.ipv4 == mme_ip->ipv4 && (!mme_ip->ipv4
|| strncmp(mme->mme_s1_ip.ipv4_address, mme_ip->ipv4_address, 16) == 0)
&& mme->mme_s1_ip.ipv6 == mme_ip->ipv6 && (!mme_ip->ipv6
|| strncmp(mme->mme_s1_ip.ipv6_address, mme_ip->ipv6_address, 46) == 0))
break;
}
if (mme)
continue;
s1ap_eNB_register_mme(new_instance,
&s1ap_register_eNB->mme_ip_address[index],
mme_ip,
&s1ap_register_eNB->enb_ip_address,
s1ap_register_eNB->sctp_in_streams,
s1ap_register_eNB->sctp_out_streams,
......
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