aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_sccp.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-21 18:56:12 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:15 +0800
commitb5513caaf8a683c082ccf3daa61682ca5a25bbf1 (patch)
tree14c44aade547f3ce787dce985f6d2cb5f2cf5506 /openbsc/src/nat/bsc_sccp.c
parentca0c2f9d1efc27df0a4ec64db3cebace2bf3742b (diff)
[nat] Lookup by BSC Connection otherwise the point of reassigning the is defeated
When sending a MSG to the MSC try to find the to be used "src" reference by comparing the reference on the BSC and the BSC connection. Only this tuple needs to be unique. Actually only when looking at the SRC REF we need to compare the BSC as the dest reference should be unique but we are just making the check a bit stronger to make it look symmetric.
Diffstat (limited to 'openbsc/src/nat/bsc_sccp.c')
-rw-r--r--openbsc/src/nat/bsc_sccp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/openbsc/src/nat/bsc_sccp.c b/openbsc/src/nat/bsc_sccp.c
index e84ffe9c1..58302cc64 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;