diff options
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 6 | ||||
-rw-r--r-- | openbsc/src/nat/bsc_sccp.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 00dcc8884..eaa9d30bc 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -524,17 +524,17 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg) case SCCP_MSG_TYPE_CR: if (create_sccp_src_ref(bsc, msg, parsed) != 0) goto exit2; - con = patch_sccp_src_ref_to_msc(msg, parsed, nat); + con = patch_sccp_src_ref_to_msc(msg, parsed, bsc); break; case SCCP_MSG_TYPE_RLSD: case SCCP_MSG_TYPE_CREF: case SCCP_MSG_TYPE_DT1: case SCCP_MSG_TYPE_CC: case SCCP_MSG_TYPE_IT: - con = patch_sccp_src_ref_to_msc(msg, parsed, nat); + con = patch_sccp_src_ref_to_msc(msg, parsed, bsc); break; case SCCP_MSG_TYPE_RLC: - con = patch_sccp_src_ref_to_msc(msg, parsed, nat); + con = patch_sccp_src_ref_to_msc(msg, parsed, bsc); remove_sccp_src_ref(bsc, msg, parsed); break; case SCCP_MSG_TYPE_UDT: diff --git a/openbsc/src/nat/bsc_sccp.c b/openbsc/src/nat/bsc_sccp.c index 2edfc5983..4ef2d551b 100644 --- a/openbsc/src/nat/bsc_sccp.c +++ b/openbsc/src/nat/bsc_sccp.c @@ -204,11 +204,14 @@ struct sccp_connections *patch_sccp_src_ref_to_bsc(struct msgb *msg, */ struct sccp_connections *patch_sccp_src_ref_to_msc(struct msgb *msg, struct bsc_nat_parsed *parsed, - struct bsc_nat *nat) + struct bsc_connection *bsc) { struct sccp_connections *conn; - llist_for_each_entry(conn, &nat->sccp_connections, list_entry) { + llist_for_each_entry(conn, &bsc->nat->sccp_connections, list_entry) { + if (conn->bsc != bsc) + continue; + if (parsed->src_local_ref) { if (equal(parsed->src_local_ref, &conn->real_ref)) { *parsed->src_local_ref = conn->patched_ref; |