pespin has uploaded this change for review.
Tear down call if local IuUP MGW address changed during MDCX
Due to ip probing used at MGW and specific/complex routing in place
between RAN and CN, it may happen that, on the RAN-side endpoint connection,
the MGW first selects a local IP address.
Then, after the HNBGW signalling it to the HNB with the patched RabAssReq
and receiving the HNB local IP address through RabAssResp, then applying
it to MGW through MDCX, it can happen that the MDCX ACK contains a changed
local IP address at the MGW, due to IP probing after learning the remote
address.
This change is so far not announced to the HNB in anyway, ending up in the
HNB sending IuUP packets to the wrong IP/port, which is rejected with ICMP
due to osmo-mgw having no socket open there anymore.
We should at least, in osmo-hnbgw, if detecting the local MGW IP address
changed during MDCX, tear down the call setup. This patch does precisely
that.
Related: OS#6127
Change-Id: I32c4a7f838ceb5077bec7945e7976ce455d6b025
---
M src/osmo-hnbgw/mgw_fsm.c
1 file changed, 62 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/43/34043/1
diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c
index f6f1089..ddab0b5 100644
--- a/src/osmo-hnbgw/mgw_fsm.c
+++ b/src/osmo-hnbgw/mgw_fsm.c
@@ -113,6 +113,7 @@
struct osmo_mgcpc_ep *mgcpc_ep;
struct osmo_mgcpc_ep_ci *mgcpc_ep_ci_hnb;
struct osmo_mgcpc_ep_ci *mgcpc_ep_ci_msc;
+ struct osmo_sockaddr ci_hnb_crcx_ack_addr;
char msc_rtp_addr[INET6_ADDRSTRLEN];
uint16_t msc_rtp_port;
};
@@ -187,8 +188,8 @@
{
struct mgw_fsm_priv *mgw_fsm_priv = fi->priv;
const struct mgcp_conn_peer *mgw_info;
- struct osmo_sockaddr addr;
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;
@@ -207,7 +208,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, &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",
@@ -217,7 +218,7 @@
}
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);
+ 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",
@@ -341,6 +342,9 @@
{
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;
+ int rc;
switch (event) {
case MGW_EV_MGCP_OK:
@@ -350,6 +354,33 @@
osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
return;
}
+
+ if (strchr(mgw_info->addr, '.'))
+ addr_str.af = AF_INET;
+ else
+ 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);
+ if (rc < 0) {
+ LOGPFSML(fi, LOGL_ERROR,
+ "Failed to convert RTP IP-address (%s) and Port (%u) to its binary representation\n",
+ mgw_info->addr, mgw_info->port);
+ osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
+ return;
+ }
+
+ 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_buf[INET6_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",
+ 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);
+ return;
+ }
+
mgw_fsm_state_chg(fi, MGW_ST_CRCX_MSC);
return;
default:
To view, visit change 34043. To unsubscribe, or for help writing mail filters, visit settings.