diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2017-09-08 04:01:42 +0200 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2018-01-30 18:59:28 +0100 |
commit | b579da010f2fdbeaf4ff155b15369bcb8bae13ed (patch) | |
tree | a592bc905393405954c117a6a59ddf7b0db9f264 /openbsc/src/osmo-bsc_nat | |
parent | 7414b37ce62b7839c20e84661a39ccb8feba039f (diff) |
osmo-bsc_nat: Make bsc_mgcp_find_con aware of multiple MGCP configs
Change-Id: I508562d48e2a0733ea53fe7adaae828286f791a2
Diffstat (limited to 'openbsc/src/osmo-bsc_nat')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 32e3f4f8e..848fcd126 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -485,8 +485,7 @@ free_stat: talloc_free(stat); } - -struct nat_sccp_connection *bsc_mgcp_find_con(struct bsc_nat *nat, int endpoint) +struct nat_sccp_connection *bsc_mgcp_find_con(struct bsc_nat *nat, struct mgcp_config *mgcp, int endpoint) { struct nat_sccp_connection *con = NULL; struct nat_sccp_connection *sccp; @@ -496,6 +495,8 @@ struct nat_sccp_connection *bsc_mgcp_find_con(struct bsc_nat *nat, int endpoint) continue; if (sccp->msc_endp != endpoint) continue; + if (sccp->mgcp_conf != mgcp) + continue; con = sccp; } @@ -542,7 +543,7 @@ static int bsc_mgcp_policy_cb(struct mgcp_trunk_config *tcfg, int endpoint, int } bsc_endp->bsc = NULL; - sccp = bsc_mgcp_find_con(nat, endpoint); + sccp = bsc_mgcp_find_con(nat, tcfg->cfg, endpoint); if (!sccp) { LOGP(DMGCP, LOGL_ERROR, "Did not find BSC for change on endpoint: 0x%x state: %d\n", endpoint, state); @@ -647,7 +648,7 @@ static void free_chan_downstream(struct mgcp_config *mgcp_cfg, struct mgcp_endpo /* if a CRCX failed... send a DLCX down the stream */ if (bsc_endp->transaction_state == MGCP_ENDP_CRCX) { struct nat_sccp_connection *con; - con = bsc_mgcp_find_con(bsc->nat, ENDPOINT_NUMBER(endp)); + con = bsc_mgcp_find_con(bsc->nat, mgcp_cfg, ENDPOINT_NUMBER(endp)); if (!con) { LOGP(DMGCP, LOGL_ERROR, "No SCCP connection for endp 0x%x\n", |