Skip to content

Commit

Permalink
Revert "fix(mme): Handling missing support for MME_UE_S1AP_ID and eNB…
Browse files Browse the repository at this point in the history
…_UE_S1AP_ID in E-RAB Modification Indication (magma#15326)" (magma#15349)

This reverts commit 7e26dbb.
  • Loading branch information
panyogesh authored Dec 9, 2023
1 parent 11811e9 commit a328c09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 91 deletions.
13 changes: 0 additions & 13 deletions lte/gateway/c/core/oai/tasks/s1ap/s1ap_mme_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4669,24 +4669,11 @@ status_code_e s1ap_mme_handle_erab_modification_indication(
S1AP_FIND_PROTOCOLIE_BY_ID(S1ap_E_RABModificationIndicationIEs_t, ie,
container, S1ap_ProtocolIE_ID_id_MME_UE_S1AP_ID,
true);
if (!ie) {
OAILOG_ERROR(LOG_S1AP,
"Missing MME_UE_S1AP_ID field in the E-RAB Modification "
"Indication S1AP packet\n");
OAILOG_FUNC_RETURN(LOG_S1AP, RETURNerror);
}

mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;

S1AP_FIND_PROTOCOLIE_BY_ID(S1ap_E_RABModificationIndicationIEs_t, ie,
container, S1ap_ProtocolIE_ID_id_eNB_UE_S1AP_ID,
true);
if (!ie) {
OAILOG_ERROR(LOG_S1AP,
"Missing eNB_UE_S1AP_ID fieldin the E-RAB Modification "
"Indication S1AP packet\n");
OAILOG_FUNC_RETURN(LOG_S1AP, RETURNerror);
}
// eNB UE S1AP ID is limited to 24 bits
enb_ue_s1ap_id =
(enb_ue_s1ap_id_t)(ie->value.choice.ENB_UE_S1AP_ID & ENB_UE_S1AP_ID_MASK);
Expand Down
78 changes: 0 additions & 78 deletions lte/gateway/c/core/oai/test/s1ap_task/test_s1ap_mme_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2695,83 +2695,5 @@ TEST_F(S1apMmeHandlersTest, MalformedUplinkNasTransportMME_UE_S1AP_ID) {
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1ap_S1AP_PDU, &pdu_s1);
}

TEST_F(S1apMmeHandlersTest, MalformedErabModificationENB_UE_S1AP_ID) {
ASSERT_EQ(task_zmq_ctx_main_s1ap.ready, true);

EXPECT_CALL(*sctp_handler, sctpd_send_dl()).Times(1);
S1ap_S1AP_PDU_t pdu_s1;
memset(&pdu_s1, 0, sizeof(pdu_s1));
ASSERT_EQ(RETURNok, generate_s1_setup_request_pdu(&pdu_s1));
ASSERT_EQ(RETURNok,
s1ap_mme_handle_message(state, assoc_id, stream_id, &pdu_s1));

// State validation
ASSERT_TRUE(is_enb_state_valid(state, assoc_id, oai::S1AP_READY, 0));
ASSERT_TRUE(is_num_enbs_valid(state, 1));

uint8_t initial_ue_bytes[] = {
0x08, 0x32, 0x3e, 0x0f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0c, 0x40, 0x5f, 0x00, 0x00,
0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x7e,
0xfa, 0xf2, 0x00, 0x46, 0x53, 0x07, 0xe0, 0x60, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x05, 0x02, 0x01, 0xd0, 0x11, 0xd1, 0x91, 0xe0, 0x6f, 0x04,
0xe0, 0x00, 0x6e, 0x00, 0x00, 0x43, 0x00, 0x06, 0x00, 0x00, 0xf1, 0x10,
0x08, 0x00, 0x00, 0xf1, 0x10, 0x00, 0x02, 0x00, 0x01, 0x00, 0x1a, 0x00,
0x2d, 0x2c, 0x17, 0x6b, 0xbf, 0x4b, 0x51, 0x17, 0xac, 0x41, 0x00, 0x00,
0x00, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0x01, 0xf2, 0x00, 0x46, 0x53, 0x07,
0xe0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x05, 0x02, 0x01, 0xd0,
0x11, 0xd1, 0x91, 0xe0, 0x6f, 0x04, 0xe0, 0x00, 0x6e, 0x00, 0x00, 0x43,
0x00, 0x06, 0x00, 0x00, 0xf1, 0x10, 0x00, 0x07, 0x00, 0x64, 0x40, 0x08,
0x00, 0x00, 0xf1, 0x10, 0x00};

ASSERT_EQ(simulate_pdu_s1_message(initial_ue_bytes, sizeof(initial_ue_bytes),
state, assoc_id, stream_id),
RETURNerror);

// Send SCTP_CLOSE_ASSOCIATION mimicing SCTP task
ASSERT_EQ(send_s1ap_close_sctp_association(assoc_id), RETURNok);

// Freeing pdu and payload data
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1ap_S1AP_PDU, &pdu_s1);
}

TEST_F(S1apMmeHandlersTest, MalformedErabModificationMME_UE_S1AP_ID) {
ASSERT_EQ(task_zmq_ctx_main_s1ap.ready, true);

EXPECT_CALL(*sctp_handler, sctpd_send_dl()).Times(1);
S1ap_S1AP_PDU_t pdu_s1;
memset(&pdu_s1, 0, sizeof(pdu_s1));
ASSERT_EQ(RETURNok, generate_s1_setup_request_pdu(&pdu_s1));
ASSERT_EQ(RETURNok,
s1ap_mme_handle_message(state, assoc_id, stream_id, &pdu_s1));

// State validation
ASSERT_TRUE(is_enb_state_valid(state, assoc_id, oai::S1AP_READY, 0));
ASSERT_TRUE(is_num_enbs_valid(state, 1));

uint8_t initial_ue_bytes[] = {
0x00, 0x32, 0x40, 0x03, 0x0e, 0x00, 0x00, 0x00, 0x54, 0x37, 0x3f,
0x00, 0x1a, 0x40, 0x39, 0x20, 0x05, 0x00, 0x80, 0x8e, 0x00, 0x00,
0x0a, 0x1c, 0x3a, 0x40, 0x21, 0x18, 0x09, 0x00, 0x3d, 0x01, 0x00,
0x7f, 0xe5, 0x48, 0xd3, 0x9c, 0x40, 0x67, 0xee, 0x44, 0xe4, 0x66,
0x00, 0x29, 0x68, 0xe2, 0xcb, 0xae, 0x00, 0x00, 0x80, 0x05, 0xc0,
0xb2, 0x3e, 0xdf, 0x17, 0x00, 0x00, 0x40, 0x04, 0x80, 0x42, 0x00,
0x40, 0x00, 0x00, 0x40, 0x05, 0xc0, 0x19, 0xcc, 0x81, 0x2c, 0x00,
0x3a, 0x40, 0x03, 0x60, 0xac, 0x40, 0x00, 0x08, 0x40, 0x04, 0xff,
0x7f, 0x00, 0x00, 0x00, 0x3a, 0x60, 0x95, 0xff, 0xff, 0x70, 0x00,
0x3a, 0x40, 0x22, 0x38, 0x40, 0x09, 0x00, 0xfe, 0xd5, 0x21, 0xfe,
0x9d, 0x44, 0xc7, 0x73, 0x44, 0x2f, 0xdd, 0x40, 0xfa, 0xd0, 0x48};

ASSERT_EQ(simulate_pdu_s1_message(initial_ue_bytes, sizeof(initial_ue_bytes),
state, assoc_id, stream_id),
RETURNerror);

// Send SCTP_CLOSE_ASSOCIATION mimicing SCTP task
ASSERT_EQ(send_s1ap_close_sctp_association(assoc_id), RETURNok);

// Freeing pdu and payload data
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1ap_S1AP_PDU, &pdu_s1);
}

} // namespace lte
} // namespace magma

0 comments on commit a328c09

Please sign in to comment.