Commit 2a03d873 authored by winckel's avatar winckel

Fixed PDN address lenght issue by replacing MME supported PDN type by requested PDN type.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4972 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 45c254d5
......@@ -82,13 +82,7 @@ static const UInt8_t _mme_api_xres[AUTH_XRES_SIZE] = {
0x00, 0x00, 0x00, 0x00
};
/* Network IP version capability */
enum {
MME_API_IPV4_ADDR,
MME_API_IPV6_ADDR,
MME_API_IPV4V6_ADDR,
MME_API_ADDR_MAX
} _mme_api_ip_capability = MME_API_IPV4V6_ADDR;
static mme_api_ip_version_t _mme_api_ip_capability = MME_API_IPV4V6_ADDR;
/* Pool of IPv4 addresses */
static uint8_t _mme_api_ipv4_addr[MME_API_PDN_MAX][4] = {
......@@ -439,7 +433,7 @@ int mme_api_new_guti(const imsi_t *imsi, GUTI_t *guti, tac_t *tac, int *n_tacs)
** Others: None **
** **
***************************************************************************/
int mme_api_subscribe(OctetString *apn, OctetString *pdn_addr,
int mme_api_subscribe(OctetString *apn, mme_api_ip_version_t mme_pdn_index, OctetString *pdn_addr,
int is_emergency, mme_api_qos_t *qos)
{
int rc = RETURNok;
......@@ -460,9 +454,9 @@ int mme_api_subscribe(OctetString *apn, OctetString *pdn_addr,
/* Assign PDN address */
if ( pdn_addr && (_mme_api_pdn_id < MME_API_PDN_MAX) ) {
pdn_addr->length =
_mme_api_pdn_addr[_mme_api_ip_capability][_mme_api_pdn_id].length;
_mme_api_pdn_addr[mme_pdn_index][_mme_api_pdn_id].length;
pdn_addr->value =
_mme_api_pdn_addr[_mme_api_ip_capability][_mme_api_pdn_id].value;
_mme_api_pdn_addr[mme_pdn_index][_mme_api_pdn_id].value;
/* Increment the total number of PDN connections */
_mme_api_pdn_id += 1;
} else {
......
......@@ -49,6 +49,14 @@ typedef enum mme_api_feature_s {
MME_API_SINGLE_ADDR_BEARERS = (1<<4),
} mme_api_feature_t;
/* Network IP version capability */
typedef enum mme_api_ip_version_e {
MME_API_IPV4_ADDR,
MME_API_IPV6_ADDR,
MME_API_IPV4V6_ADDR,
MME_API_ADDR_MAX
} mme_api_ip_version_t;
/*
* EPS Mobility Management configuration data
* ------------------------------------------
......@@ -105,7 +113,7 @@ int mme_api_identify_imsi(const imsi_t *imsi, auth_vector_t *vector);
int mme_api_identify_imei(const imei_t *imei, auth_vector_t *vector);
int mme_api_new_guti(const imsi_t *imsi, GUTI_t *guti, tac_t *tac, int *n_tacs);
int mme_api_subscribe(OctetString *apn, OctetString *pdn_addr,
int mme_api_subscribe(OctetString *apn, mme_api_ip_version_t mme_pdn_index, OctetString *pdn_addr,
int is_emergency, mme_api_qos_t *qos);
int mme_api_unsubscribe(OctetString *apn);
......
......@@ -663,11 +663,28 @@ int esm_proc_pdn_connectivity_request(emm_data_context_t *ctx, int pti,
}
if (rc != RETURNerror) {
mme_api_ip_version_t mme_pdn_index;
int is_emergency = (request_type == ESM_PDN_REQUEST_EMERGENCY);
mme_api_qos_t qos;
switch (pdn_type)
{
case ESM_PDN_TYPE_IPV4:
mme_pdn_index = MME_API_IPV4_ADDR;
break;
case ESM_PDN_TYPE_IPV6:
mme_pdn_index = MME_API_IPV6_ADDR;
break;
case ESM_PDN_TYPE_IPV4V6:
default:
mme_pdn_index = MME_API_IPV4V6_ADDR;
break;
}
/* Check if connectivity with the requested PDN can be established */
rc = mme_api_subscribe(apn, pdn_addr, is_emergency, &qos);
rc = mme_api_subscribe(apn, mme_pdn_index, pdn_addr, is_emergency, &qos);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "ESM-PROC - Connectivity to the requested PDN "
......
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