aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2017-09-15 13:52:04 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2018-01-30 18:59:28 +0100
commit7d888c1eb908bfb53c458cd680398542edf01f89 (patch)
tree3b0805bff24da56aefdec290fff97725bdd376a6 /openbsc/src/osmo-bsc_nat
parent25201ea5b5d7cdaf72187c7d62e06d05f91d3bd0 (diff)
libmgcp: Pass the pointer to the mgcp list on init, don't copy it
Diffstat (limited to 'openbsc/src/osmo-bsc_nat')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c6
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c4
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat_utils.c1
3 files changed, 5 insertions, 6 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index 848fcd126..6b57445ab 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -258,7 +258,7 @@ void bsc_mgcp_free_endpoints(struct bsc_nat *nat)
int i;
struct mgcp_config *mgcp_cfg;
- llist_for_each_entry(mgcp_cfg, &nat->mgcp_cfgs, entry) {
+ llist_for_each_entry(mgcp_cfg, nat->mgcp_cfgs, entry) {
for (i = 1; i < mgcp_cfg->trunk.number_endpoints; ++i){
bsc_mgcp_free_endpoint(mgcp_cfg, i);
mgcp_release_endp(&mgcp_cfg->trunk.endpoints[i]);
@@ -733,7 +733,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
return;
}
- llist_for_each_entry(mgcp_cfg, &bsc->nat->mgcp_cfgs, entry) {
+ llist_for_each_entry(mgcp_cfg, bsc->nat->mgcp_cfgs, entry) {
mgcp_nat = mgcp_cfg->data;
for (i = 1; i < mgcp_cfg->trunk.number_endpoints; ++i) {
if (mgcp_nat->bsc_endpoints[i].bsc != bsc)
@@ -1175,7 +1175,7 @@ void bsc_mgcp_clear_endpoints_for(struct bsc_connection *bsc)
if (bsc->cfg)
ctr = &bsc->cfg->stats.ctrg->ctr[BCFG_CTR_DROPPED_CALLS];
- llist_for_each_entry(mgcp_cfg, &bsc->nat->mgcp_cfgs, entry) {
+ llist_for_each_entry(mgcp_cfg, bsc->nat->mgcp_cfgs, entry) {
mgcp_nat = mgcp_cfg->data;
for (i = 1; i < mgcp_cfg->trunk.number_endpoints; ++i) {
struct bsc_endpoint *bsc_endp = &mgcp_nat->bsc_endpoints[i];
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index faa65257a..8c4561133 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1169,7 +1169,7 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
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->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;
@@ -1660,7 +1660,7 @@ int main(int argc, char **argv)
/*
* Setup the MGCP code..
*/
- if (bsc_mgcp_nat_init(nat, &nat->mgcp_cfgs) != 0)
+ if (bsc_mgcp_nat_init(nat, nat->mgcp_cfgs) != 0)
return -4;
/* start control interface after reading config for
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
index dda679472..5ab5fb38b 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c
@@ -87,7 +87,6 @@ struct bsc_nat *bsc_nat_alloc(void)
INIT_LLIST_HEAD(&nat->tpdest_match);
INIT_LLIST_HEAD(&nat->sms_clear_tp_srr);
INIT_LLIST_HEAD(&nat->sms_num_rewr);
- INIT_LLIST_HEAD(&nat->mgcp_cfgs);
nat->stats.sccp.conn = osmo_counter_alloc("nat.sccp.conn");
nat->stats.sccp.calls = osmo_counter_alloc("nat.sccp.calls");