diff --git a/srsepc/hdr/spgw/spgw.h b/srsepc/hdr/spgw/spgw.h index d39e6a6ba..00d2ebd12 100644 --- a/srsepc/hdr/spgw/spgw.h +++ b/srsepc/hdr/spgw/spgw.h @@ -77,6 +77,7 @@ public: void handle_modify_bearer_request(struct srslte::gtpc_pdu *mb_req_pdu, struct srslte::gtpc_pdu *mb_resp_pdu); void handle_sgi_pdu(srslte::byte_buffer_t *msg); + void handle_s1u_pdu(srslte::byte_buffer_t *msg); private: diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 4cef13cab..a6bd64faf 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -626,7 +626,7 @@ s1ap::send_initial_context_setup_request(uint32_t mme_ue_s1ap_id, struct srslte: return false; } erab_ctxt->transportLayerAddress.n_bits = 32; //IPv4 - uint32_t sgw_s1u_ip = cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid.ipv4; + uint32_t sgw_s1u_ip = htonl(cs_resp->eps_bearer_context_created.s1_u_sgw_f_teid.ipv4); uint8_t *tmp_ptr = erab_ctxt->transportLayerAddress.buffer; liblte_value_2_bits(sgw_s1u_ip, &tmp_ptr, 32);//FIXME consider ipv6 diff --git a/srsepc/src/spgw/spgw.cc b/srsepc/src/spgw/spgw.cc index d31cf6832..02e5dfd18 100644 --- a/srsepc/src/spgw/spgw.cc +++ b/srsepc/src/spgw/spgw.cc @@ -274,6 +274,7 @@ spgw::run_thread() msg->N_bytes = recvfrom(m_s1u, msg->msg, SRSLTE_MAX_BUFFER_SIZE_BYTES, 0, &src_addr, &addrlen ); //m_spgw_log->console("Received PDU from S1-U. Bytes %d\n", msg->N_bytes); //m_spgw_log->debug("Received PDU from S1-U. Bytes %d\n", msg->N_bytes); + handle_s1u_pdu(msg); } if (FD_ISSET(m_sgi_if, &set)) { @@ -359,6 +360,13 @@ spgw::handle_sgi_pdu(srslte::byte_buffer_t *msg) return; } + +void +spgw::handle_s1u_pdu(srslte::byte_buffer_t *msg) +{ + m_spgw_log->console("Received PDU from S1-U. Bytes=%d\n",msg->N_bytes); + return; +} uint64_t spgw::get_new_ctrl_teid() {