aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-05 21:44:51 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:11 +0800
commit9d51855f66e1a2fe227c76c200ce8d0c9b55361c (patch)
treeb6ffac369d9e5d03e8c3dbe4b2e5ae19f1601797 /openbsc
parent560af50422e43b3c9e26e911bec41a37c2c2834f (diff)
nat: remove is called on already patched connections..
Fix the test to search for the original message instead of the already patched one that should not find any items anyway. The remove is called on already patched connections so we need to match it with the patch reference count.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/nat/bsc_sccp.c6
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/openbsc/src/nat/bsc_sccp.c b/openbsc/src/nat/bsc_sccp.c
index a744d3410..6e05a0314 100644
--- a/openbsc/src/nat/bsc_sccp.c
+++ b/openbsc/src/nat/bsc_sccp.c
@@ -129,11 +129,7 @@ void remove_sccp_src_ref(struct bsc_connection *bsc, struct msgb *msg, struct bs
llist_for_each_entry(conn, &bsc->nat->sccp_connections, list_entry) {
if (memcmp(parsed->src_local_ref,
- &conn->real_ref, sizeof(conn->real_ref)) == 0) {
-
- /* two BSCs have used the same real ref... this is why we rewrite it */
- if (bsc != conn->bsc)
- continue;
+ &conn->patched_ref, sizeof(conn->patched_ref)) == 0) {
sccp_connection_destroy(conn);
return;
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 705372c8d..8ec5914ec 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -290,6 +290,10 @@ static void test_contrack()
abort();
}
remove_sccp_src_ref(con, msg, parsed);
+ talloc_free(parsed);
+
+ copy_to_msg(msg, bsc_rlc, sizeof(bsc_rlc));
+ parsed = bsc_nat_parse(msg);
con_found = patch_sccp_src_ref_to_msc(msg, parsed, nat);
/* verify that it is gone */