aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
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-04-21 18:56:12 +0800
commit93cc16ae4f85c8712f50881f094c1ac6882f99f3 (patch)
tree52c332b45d480fac9da17f8caf3c4088009eb99c /openbsc/tests
parent119a1976f538d671e7c9b097f2dc8aff76d3be15 (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/tests')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 19d8d3a27..4666c3b23 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -267,7 +267,7 @@ static void test_contrack()
/* 1.) create a connection */
copy_to_msg(msg, bsc_cr, sizeof(bsc_cr));
parsed = bsc_nat_parse(msg);
- con_found = patch_sccp_src_ref_to_msc(msg, parsed, nat);
+ con_found = patch_sccp_src_ref_to_msc(msg, parsed, con);
if (con_found != NULL) {
fprintf(stderr, "Con should not exist %p\n", con_found);
abort();
@@ -277,7 +277,7 @@ static void test_contrack()
fprintf(stderr, "Failed to create a ref\n");
abort();
}
- con_found = patch_sccp_src_ref_to_msc(msg, parsed, nat);
+ con_found = patch_sccp_src_ref_to_msc(msg, parsed, con);
if (!con_found || con_found->bsc != con) {
fprintf(stderr, "Failed to find the con: %p\n", con_found);
abort();
@@ -301,7 +301,7 @@ static void test_contrack()
/* 3.) send some data */
copy_to_msg(msg, bsc_dtap, sizeof(bsc_dtap));
parsed = bsc_nat_parse(msg);
- con_found = patch_sccp_src_ref_to_msc(msg, parsed, nat);
+ con_found = patch_sccp_src_ref_to_msc(msg, parsed, con);
VERIFY(con_found, con, msg, bsc_dtap_patched, "BSC DTAP");
/* 4.) receive some data */
@@ -319,7 +319,7 @@ static void test_contrack()
/* 6.) confirm the connection close */
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);
+ con_found = patch_sccp_src_ref_to_msc(msg, parsed, con);
if (!con_found || con_found->bsc != con) {
fprintf(stderr, "Failed to find the con: %p\n", con_found);
abort();
@@ -333,7 +333,7 @@ static void test_contrack()
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);
+ con_found = patch_sccp_src_ref_to_msc(msg, parsed, con);
/* verify that it is gone */
if (con_found != NULL) {