diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2017-09-08 04:00:08 +0200 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2018-01-30 18:59:28 +0100 |
commit | 7414b37ce62b7839c20e84661a39ccb8feba039f (patch) | |
tree | 2dae9e8dbfb0740c4a9ff0ef7087c3c07e2cdc58 /openbsc/src | |
parent | daf3885b1a848a1a9896cc70a18bbcf5f380f468 (diff) |
osmo-bsc_nat: Handle multiple mgcp configs in SCCP conn
Change-Id: Ifb6efa8339b749ab588a5ea37f0b48bc8086ae46
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 4 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 1a97537fc..32e3f4f8e 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -204,7 +204,7 @@ int bsc_mgcp_assign_patch(struct nat_sccp_connection *con, struct msgb *msg) endp = mgcp_timeslot_to_endpoint(multiplex, timeslot); - if (endp >= con->bsc->nat->mgcp_cfg->trunk.number_endpoints) { + if (endp >= con->mgcp_conf->trunk.number_endpoints) { LOGP(DNAT, LOGL_ERROR, "MSC attempted to assign bad endpoint 0x%x\n", endp); @@ -336,7 +336,7 @@ static void remember_pending_dlcx(struct nat_sccp_connection *con, uint32_t tran } /* take the endpoint here */ - endp = &bsc->nat->mgcp_cfg->trunk.endpoints[con->msc_endp]; + endp = &con->mgcp_conf->trunk.endpoints[con->msc_endp]; stats->remote_ref = con->remote_ref; stats->src_ref = con->patched_ref; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 89f99064d..faa65257a 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1167,6 +1167,10 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) con->msc_con = msc_conn_by_num(bsc->nat, bsc->nat->default_msc); } con_msc = con->msc_con; + /* Shortcuts for handling later */ + con->msc_conf = msc_config_by_con(bsc->nat, con_msc); + con->mgcp_conf = mgcp_config_by_num(&bsc->nat->mgcp_cfgs, con->msc_conf->nr); + con->filter_state.con_type = con_type; con->filter_state.imsi_checked = filter; bsc_nat_extract_lac(bsc, con, parsed, msg); |