forked from acouzens/open5gs
fix: the unexpected PDN type error (#721)
This commit is contained in:
parent
2bf8d6c3c7
commit
2392f23d7f
|
@ -228,6 +228,12 @@ ED2(uint8_t spare:5;,
|
|||
#define OGS_PFCP_PDN_TYPE_IPV6 OGS_PDU_SESSION_TYPE_IPV6
|
||||
#define OGS_PFCP_PDN_TYPE_IPV4V6 OGS_PDU_SESSION_TYPE_IPV4V6
|
||||
#define OGS_PFCP_PDN_TYPE_NONIP OGS_PDU_SESSION_TYPE_NONIP
|
||||
|
||||
#define OGS_GTP_PDN_TYPE_IS_VALID(x) \
|
||||
((x) == OGS_GTP_PDN_TYPE_IPV4 || \
|
||||
(x) == OGS_GTP_PDN_TYPE_IPV6 || \
|
||||
(x) == OGS_GTP_PDN_TYPE_IPV4V6) \
|
||||
|
||||
uint8_t pdn_type:3;)
|
||||
union {
|
||||
/* GTP_PDN_TYPE_IPV4 */
|
||||
|
|
|
@ -213,8 +213,8 @@ ogs_pkbuf_t *esm_build_activate_default_bearer_context_request(
|
|||
pdn_address->length = OGS_NAS_PDU_ADDRESS_IPV4V6_LEN;
|
||||
ogs_debug(" IPv4v6");
|
||||
} else {
|
||||
ogs_error("Unexpected PDN Type %u", pdn_address->pdn_type);
|
||||
return NULL;
|
||||
ogs_fatal("Unexpected PDN Type %u", pdn_address->pdn_type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
if (pdn->ambr.downlink || pdn->ambr.uplink) {
|
||||
|
|
|
@ -148,30 +148,14 @@ int esm_handle_information_response(mme_sess_t *sess,
|
|||
if (sess->pdn) {
|
||||
ogs_debug(" APN[%s]", sess->pdn->apn);
|
||||
|
||||
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
|
||||
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue) &&
|
||||
OGS_GTP_PDN_TYPE_IS_VALID(sess->pdn->paa.pdn_type)) {
|
||||
mme_csmap_t *csmap = mme_csmap_find_by_tai(&mme_ue->tai);
|
||||
mme_ue->csmap = csmap;
|
||||
|
||||
if (csmap) {
|
||||
sgsap_send_location_update_request(mme_ue);
|
||||
} else {
|
||||
|
||||
if (sess->pdn->paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4) {
|
||||
/* Nothing */
|
||||
} else if (sess->pdn->paa.pdn_type == OGS_GTP_PDN_TYPE_IPV6) {
|
||||
/* Nothing */
|
||||
} else if (sess->pdn->paa.pdn_type == OGS_GTP_PDN_TYPE_IPV4V6) {
|
||||
/* Nothing */
|
||||
} else {
|
||||
ogs_error("Unknown PDN[%s] Type %u:%u",
|
||||
sess->pdn->apn,
|
||||
sess->pdn->pdn_type,
|
||||
sess->pdn->paa.pdn_type);
|
||||
nas_eps_send_pdn_connectivity_reject(
|
||||
sess, ESM_CAUSE_UNKNOWN_PDN_TYPE);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
nas_eps_send_attach_accept(mme_ue);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -126,6 +126,18 @@ void mme_s11_handle_create_session_response(
|
|||
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_MISSING;
|
||||
}
|
||||
|
||||
if (rsp->pdn_address_allocation.presence) {
|
||||
ogs_paa_t paa;
|
||||
|
||||
memcpy(&paa, rsp->pdn_address_allocation.data,
|
||||
rsp->pdn_address_allocation.len);
|
||||
|
||||
if (!OGS_GTP_PDN_TYPE_IS_VALID(paa.pdn_type)) {
|
||||
ogs_error("Unknown PDN Type[%u]", paa.pdn_type);
|
||||
cause_value = OGS_GTP_CAUSE_MANDATORY_IE_INCORRECT;
|
||||
}
|
||||
}
|
||||
|
||||
if (cause_value != OGS_GTP_CAUSE_REQUEST_ACCEPTED) {
|
||||
if (sess && SESSION_CONTEXT_IN_ATTACH(sess)) {
|
||||
ogs_error("[%s] Attach reject", mme_ue->imsi_bcd);
|
||||
|
@ -195,12 +207,15 @@ void mme_s11_handle_create_session_response(
|
|||
mme_ue->csmap = csmap;
|
||||
|
||||
if (csmap) {
|
||||
ogs_assert(OGS_GTP_PDN_TYPE_IS_VALID(pdn->paa.pdn_type));
|
||||
sgsap_send_location_update_request(mme_ue);
|
||||
} else {
|
||||
ogs_assert(OGS_GTP_PDN_TYPE_IS_VALID(pdn->paa.pdn_type));
|
||||
nas_eps_send_attach_accept(mme_ue);
|
||||
}
|
||||
|
||||
} else {
|
||||
ogs_assert(OGS_GTP_PDN_TYPE_IS_VALID(pdn->paa.pdn_type));
|
||||
nas_eps_send_activate_default_bearer_context_request(bearer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue