aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2017-11-30 16:56:58 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 18:59:28 +0100
commitdad6ed7a66838787322e458032d637d1aca89e59 (patch)
treea5b73b532272003589c8e90e42affe32e081c874
parent7d888c1eb908bfb53c458cd680398542edf01f89 (diff)
bsc_nat: Fix selection of mgcp_config in bsc_mgcp_forward()
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index 6b57445ab..44048201f 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -712,7 +712,7 @@ err:
*/
void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
{
- struct mgcp_config *mgcp_cfg;
+ struct mgcp_config *mgcp_cfg, *mgcp_found = NULL;
struct mgcp_nat_config *mgcp_nat;
struct msgb *output;
struct bsc_endpoint *bsc_endp = NULL;
@@ -746,6 +746,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
endp = &mgcp_cfg->trunk.endpoints[i];
bsc_endp = &mgcp_nat->bsc_endpoints[i];
+ mgcp_found = mgcp_cfg;
break;
}
}
@@ -763,7 +764,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
endp->ci = bsc_mgcp_extract_ci((const char *) msg->l2h);
if (endp->ci == CI_UNUSED) {
- free_chan_downstream(mgcp_cfg, endp, bsc_endp, bsc);
+ free_chan_downstream(mgcp_found, endp, bsc_endp, bsc);
return;
}
@@ -771,12 +772,12 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
bsc_mgcp_osmux_confirm(endp, (const char *) msg->l2h);
/* If we require osmux and it is disabled.. fail */
- if (nat_osmux_only(mgcp_cfg, bsc->cfg) &&
+ if (nat_osmux_only(mgcp_found, bsc->cfg) &&
endp->osmux.state == OSMUX_STATE_DISABLED) {
LOGP(DMGCP, LOGL_ERROR,
"Failed to activate osmux endpoint 0x%x\n",
ENDPOINT_NUMBER(endp));
- free_chan_downstream(mgcp_cfg, endp, bsc_endp, bsc);
+ free_chan_downstream(mgcp_found, endp, bsc_endp, bsc);
return;
}
@@ -800,7 +801,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
return;
}
- mgcp_queue_for_call_agent(mgcp_cfg, output);
+ mgcp_queue_for_call_agent(mgcp_found, output);
}
int bsc_mgcp_parse_response(const char *str, int *code, char transaction[60])