Projects
osmocom:master
osmo-hnbgw
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 69
View file
osmo-hnbgw.spec
Changed
@@ -18,13 +18,13 @@ Name: osmo-hnbgw Requires: osmocom-master -Version: 1.5.0.9.656d +Version: 1.5.0.10.5755 Release: 0 Summary: OsmoHNBGW: Osmocom's Base Station Controller for 2G CS mobile networks License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Hardware/Mobile URL: https://osmocom.org/projects/osmohnbgw -Source: osmo-hnbgw_1.5.0.9.656d.tar.xz +Source: osmo-hnbgw_1.5.0.10.5755.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2
View file
commit_5755268f9b598e2955b1d1b23b0d29e64400c024.txt
Added
View file
commit_656d1d27788a000b93f00cf9cdf659e0dacadde7.txt
Deleted
View file
osmo-hnbgw_1.5.0.9.656d.dsc -> osmo-hnbgw_1.5.0.10.5755.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-hnbgw Binary: osmo-hnbgw, osmo-hnbgw-dbg, osmo-hnbgw-doc Architecture: any all -Version: 1.5.0.9.656d +Version: 1.5.0.10.5755 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hnbgw Standards-Version: 3.9.8 @@ -14,8 +14,8 @@ osmo-hnbgw-dbg deb debug extra arch=any osmo-hnbgw-doc deb doc optional arch=all Checksums-Sha1: - 20144141a97a28af74a3aad19fc5a6e70f0a1309 99920 osmo-hnbgw_1.5.0.9.656d.tar.xz + 7cc2d5d3fb1daac2f9bc0bea8b4c0d5977197bba 100232 osmo-hnbgw_1.5.0.10.5755.tar.xz Checksums-Sha256: - f728366aceb0294b3e1d635f455b6157acc6b336ed11563df2a421f60fe614b1 99920 osmo-hnbgw_1.5.0.9.656d.tar.xz + 9fc1bd1417c87260aca484d50c0ce1efad01ff3929fb20378c91cfce74d5202b 100232 osmo-hnbgw_1.5.0.10.5755.tar.xz Files: - ef3b4631b9e23f6fe6af5ef69c42d8e7 99920 osmo-hnbgw_1.5.0.9.656d.tar.xz + 45c686de2ee8075bc4c1a3565c784363 100232 osmo-hnbgw_1.5.0.10.5755.tar.xz
View file
osmo-hnbgw_1.5.0.9.656d.tar.xz/.tarball-version -> osmo-hnbgw_1.5.0.10.5755.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.5.0.9-656d +1.5.0.10-5755
View file
osmo-hnbgw_1.5.0.9.656d.tar.xz/debian/changelog -> osmo-hnbgw_1.5.0.10.5755.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hnbgw (1.5.0.9.656d) unstable; urgency=medium +osmo-hnbgw (1.5.0.10.5755) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Mon, 04 Dec 2023 12:10:49 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Mon, 04 Dec 2023 16:50:45 +0000 osmo-hnbgw (1.5.0) unstable; urgency=medium
View file
osmo-hnbgw_1.5.0.9.656d.tar.xz/src/osmo-hnbgw/mgw_fsm.c -> osmo-hnbgw_1.5.0.10.5755.tar.xz/src/osmo-hnbgw/mgw_fsm.c
Changed
@@ -109,6 +109,11 @@ ranap_message *ranap_rab_ass_req_message; ranap_message *ranap_rab_ass_resp_message; struct msgb *ranap_rab_ass_resp_msgb; + /* IP address contained in ranap_rab_ass_resp_msgb/message: */ + struct osmo_sockaddr hnb_rtp_addr; + /* Number of MDCX transmitted. Used to detect current mgw conn_mode and + * detect modify infinite loops: */ + unsigned int mdcx_tx_cnt; /* MGW context */ struct mgcp_client *mgcpc; @@ -205,8 +210,6 @@ struct mgw_fsm_priv *mgw_fsm_priv = fi->priv; const struct mgcp_conn_peer *mgw_info; struct osmo_sockaddr_str addr_str; - struct osmo_sockaddr *addr = &mgw_fsm_priv->ci_hnb_crcx_ack_addr; - RANAP_RAB_AssignmentRequestIEs_t *ies; int rc; switch (event) { @@ -224,7 +227,7 @@ addr_str.af = AF_INET6; addr_str.port = mgw_info->port; osmo_strlcpy(addr_str.ip, mgw_info->addr, sizeof(addr_str.ip)); - rc = osmo_sockaddr_str_to_sockaddr(&addr_str, &addr->u.sas); + rc = osmo_sockaddr_str_to_sockaddr(&addr_str, &mgw_fsm_priv->ci_hnb_crcx_ack_addr.u.sas); if (rc < 0) { LOGPFSML(fi, LOGL_ERROR, "Failed to convert RTP IP-address (%s) and Port (%u) to its binary representation\n", @@ -233,16 +236,6 @@ return; } - ies = &mgw_fsm_priv->ranap_rab_ass_req_message->msg.raB_AssignmentRequestIEs; - rc = ranap_rab_ass_req_ies_replace_inet_addr(ies, addr, mgw_fsm_priv->rab_id); - if (rc < 0) { - LOGPFSML(fi, LOGL_ERROR, - "Failed to replace RTP IP-address (%s) and Port (%u) in RAB-AssignmentRequest\n", - mgw_info->addr, mgw_info->port); - osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); - return; - } - mgw_fsm_state_chg(fi, MGW_ST_ASSIGN); return; default: @@ -256,8 +249,16 @@ struct hnbgw_context_map *map = mgw_fsm_priv->map; RANAP_RAB_AssignmentRequestIEs_t *ies; struct msgb *msg; + int rc; ies = &mgw_fsm_priv->ranap_rab_ass_req_message->msg.raB_AssignmentRequestIEs; + rc = ranap_rab_ass_req_ies_replace_inet_addr(ies, &mgw_fsm_priv->ci_hnb_crcx_ack_addr, mgw_fsm_priv->rab_id); + if (rc < 0) { + LOGPFSML(fi, LOGL_ERROR, "Failed to replace RTP IP-address and Port in RAB-AssignmentRequest\n"); + osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); + return; + } + msg = ranap_rab_ass_req_encode(ies); if (!msg) { LOGPFSML(fi, LOGL_ERROR, "failed to re-encode RAB-AssignmentRequest message\n"); @@ -273,9 +274,74 @@ static void mgw_fsm_assign(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct mgw_fsm_priv *mgw_fsm_priv = fi->priv; + struct hnbgw_context_map *map = mgw_fsm_priv->map; + RANAP_RAB_AssignmentResponseIEs_t *ies; + bool rab_failed_at_hnb; + struct osmo_sockaddr addr; + enum mgw_fsm_state next_st; + int rc; + switch (event) { case MGW_EV_RAB_ASS_RESP: - mgw_fsm_state_chg(fi, MGW_ST_MDCX_HNB); + LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentResponse received, completing HNB side call-leg on MGW...\n"); + ies = &mgw_fsm_priv->ranap_rab_ass_resp_message->msg.raB_AssignmentResponseIEs; + rc = ranap_rab_ass_resp_ies_extract_inet_addr(&addr, ies, mgw_fsm_priv->rab_id); + if (rc < 0) { + rab_failed_at_hnb = ranap_rab_ass_resp_ies_check_failure(ies, mgw_fsm_priv->rab_id); + if (rab_failed_at_hnb) { + struct msgb *msg; + + LOGPFSML(fi, LOGL_ERROR, + "The RAB-AssignmentResponse contains a RAB-FailedList, RAB-Assignment (%u) failed.\n", + mgw_fsm_priv->rab_id); + + /* Forward the RAB-AssignmentResponse transparently. This will ensure that the MSC + * is informed about the problem. */ + LOGPFSML(fi, LOGL_DEBUG, "forwarding unmodified RAB-AssignmentResponse to MSC\n"); + + msg = mgw_fsm_priv->ranap_rab_ass_resp_msgb; + mgw_fsm_priv->ranap_rab_ass_resp_msgb = NULL; + talloc_steal(OTC_SELECT, msg); + + rc = map_sccp_dispatch(map, MAP_SCCP_EV_TX_DATA_REQUEST, msg); + if (rc < 0) { + LOGPFSML(fi, LOGL_DEBUG, "failed to forward RAB-AssignmentResponse message\n"); + osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); + } + + /* Even though this is a failure situation, we still release normally as the error is located + * at the HNB. */ + osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0); + return; + } + + /* The RAB-ID we are dealing with is not on an FailedList and we were unable to parse the response + * normally. This is a situation we cannot recover from. */ + LOGPFSML(fi, LOGL_ERROR, "Failed to extract RTP IP-address and Port from RAB-AssignmentResponse\n"); + osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); + return; + } + + /* Break infinite loops modifications between HNB and our MGW: */ + if (mgw_fsm_priv->mdcx_tx_cnt > 3) { + LOGPFSML(fi, LOGL_ERROR, "IuUP addr modification infinite loop detected between HNB and MGW, " + "check your network routing config -- abort!\n"); + osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0); + return; + } + + /* Send at least 1 MDCX in order to change conn_mode to SEND_RECV. + * From there on, MDCX is only needed if HNB IP/Port changed: */ + if (mgw_fsm_priv->mdcx_tx_cnt == 0 || + osmo_sockaddr_cmp(&addr, &mgw_fsm_priv->hnb_rtp_addr) != 0) { + next_st = MGW_ST_MDCX_HNB; + } else { + LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentResponse received with unchanged IuUP attributes, skipping MDCX...\n"); + next_st = MGW_ST_CRCX_MSC; + } + mgw_fsm_priv->hnb_rtp_addr = addr; + mgw_fsm_state_chg(fi, next_st); return; default: OSMO_ASSERT(false); @@ -287,13 +353,8 @@ struct mgw_fsm_priv *mgw_fsm_priv = fi->priv; struct hnbgw_context_map *map = mgw_fsm_priv->map; struct mgcp_conn_peer mgw_info; - struct osmo_sockaddr addr; struct osmo_sockaddr_str addr_str; - RANAP_RAB_AssignmentResponseIEs_t *ies; int rc; - bool rab_failed_at_hnb; - - LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentResponse received, completing HNB side call-leg on MGW...\n"); mgw_info = (struct mgcp_conn_peer) { .call_id = map->rua_ctx_id, @@ -303,53 +364,17 @@ mgw_info.codecs0 = CODEC_IUFP; mgw_info.codecs_len = 1; - ies = &mgw_fsm_priv->ranap_rab_ass_resp_message->msg.raB_AssignmentResponseIEs; - rc = ranap_rab_ass_resp_ies_extract_inet_addr(&addr, ies, mgw_fsm_priv->rab_id); - if (rc < 0) { - rab_failed_at_hnb = ranap_rab_ass_resp_ies_check_failure(ies, mgw_fsm_priv->rab_id); - if (rab_failed_at_hnb) { - struct msgb *msg; - - LOGPFSML(fi, LOGL_ERROR, - "The RAB-AssignmentResponse contains a RAB-FailedList, RAB-Assignment (%u) failed.\n", - mgw_fsm_priv->rab_id); - - /* Forward the RAB-AssignmentResponse transparently. This will ensure that the MSC is informed - * about the problem. */ - LOGPFSML(fi, LOGL_DEBUG, "forwarding unmodified RAB-AssignmentResponse to MSC\n"); - - msg = mgw_fsm_priv->ranap_rab_ass_resp_msgb; - mgw_fsm_priv->ranap_rab_ass_resp_msgb = NULL; - talloc_steal(OTC_SELECT, msg); - - rc = map_sccp_dispatch(map, MAP_SCCP_EV_TX_DATA_REQUEST, msg); - if (rc < 0) { - LOGPFSML(fi, LOGL_DEBUG, "failed to forward RAB-AssignmentResponse message\n"); - osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); - } - - /* Even though this is a failure situation, we still release normally as the error is located - * at the HNB. */ - osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0); - return; - } - - /* The RAB-ID we are dealing with is not on an FailedList and we were unable to parse the response - * normally. This is a situation we cannot recover from. */ - LOGPFSML(fi, LOGL_ERROR, "Failed to extract RTP IP-address and Port from RAB-AssignmentResponse\n"); - osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); - return; - } - - rc = osmo_sockaddr_str_from_sockaddr(&addr_str, &addr.u.sas); + rc = osmo_sockaddr_str_from_sockaddr(&addr_str, &mgw_fsm_priv->hnb_rtp_addr.u.sas); if (rc < 0) { LOGPFSML(fi, LOGL_ERROR, "Invalid RTP IP-address or Port in RAB-AssignmentResponse\n"); osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); return; } + osmo_strlcpy(mgw_info.addr, addr_str.ip, sizeof(mgw_info.addr)); mgw_info.port = addr_str.port; + mgw_fsm_priv->mdcx_tx_cnt++; osmo_mgcpc_ep_ci_request(mgw_fsm_priv->mgcpc_ep_ci_hnb, MGCP_VERB_MDCX, &mgw_info, fi, MGW_EV_MGCP_OK, MGW_EV_MGCP_FAIL, NULL); } @@ -387,13 +412,14 @@ } if (osmo_sockaddr_cmp(&mgw_fsm_priv->ci_hnb_crcx_ack_addr, &addr) != 0) { - /* FIXME: Send RAB Modify Req to HNB. See OS#6127 */ char addr_bufINET6_ADDRSTRLEN + 8; - LOGPFSML(fi, LOGL_ERROR, "Local MGW IuUP IP address %s changed to %s during MDCX." - " This is so far unsupported, adapt your osmo-mgw config!\n", + LOGPFSML(fi, LOGL_INFO, "Local MGW IuUP IP address %s changed to %s during MDCX." + " Modifying RAB on HNB.\n", osmo_sockaddr_to_str(&mgw_fsm_priv->ci_hnb_crcx_ack_addr), osmo_sockaddr_to_str_buf(addr_buf, sizeof(addr_buf), &addr)); - osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0); + /* Modify RAB on the HNB with the new local IuUP address (OS#6127): */ + mgw_fsm_priv->ci_hnb_crcx_ack_addr = addr; + mgw_fsm_state_chg(fi, MGW_ST_ASSIGN); return; } @@ -619,6 +645,7 @@ .in_event_mask = S(MGW_EV_RAB_ASS_RESP), .out_state_mask = S(MGW_ST_MDCX_HNB) | + S(MGW_ST_CRCX_MSC) | S(MGW_ST_FAILURE) | S(MGW_ST_RELEASE), }, @@ -629,6 +656,7 @@ .in_event_mask = S(MGW_EV_MGCP_OK), .out_state_mask = + S(MGW_ST_ASSIGN) | S(MGW_ST_CRCX_MSC) | S(MGW_ST_FAILURE) | S(MGW_ST_RELEASE),
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.