aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/bsc-nat
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 16:51:31 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:20 +0800
commitfa20c944569e4eaf79370672ff571cb5330ff1b2 (patch)
tree9e0bc748f014429058fa998b290d544114f9d675 /openbsc/tests/bsc-nat
parente1fb5670cda5ba099c24a6656058b98771fa2f3b (diff)
[nat] Make create_sccp_src_ref return the SCCP Connection.
Right now it was not possible to just find a connection, by returning the connection that is created we will have direct access to it. It will be used by the local connection handling.
Diffstat (limited to 'openbsc/tests/bsc-nat')
-rw-r--r--openbsc/tests/bsc-nat/bsc_nat_test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index ca9fbd4dd..6ad987034 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -273,10 +273,10 @@ static void copy_to_msg(struct msgb *msg, const u_int8_t *data, unsigned int len
/* test conn tracking once */
static void test_contrack()
{
- int rc;
struct bsc_nat *nat;
struct bsc_connection *con;
struct sccp_connections *con_found;
+ struct sccp_connections *rc_con;
struct bsc_nat_parsed *parsed;
struct msgb *msg;
@@ -294,8 +294,8 @@ static void test_contrack()
fprintf(stderr, "Con should not exist %p\n", con_found);
abort();
}
- rc = create_sccp_src_ref(con, parsed);
- if (rc != 0) {
+ rc_con = create_sccp_src_ref(con, parsed);
+ if (!rc_con) {
fprintf(stderr, "Failed to create a ref\n");
abort();
}
@@ -304,6 +304,10 @@ static void test_contrack()
fprintf(stderr, "Failed to find the con: %p\n", con_found);
abort();
}
+ if (con_found != rc_con) {
+ fprintf(stderr, "Failed to find the right connection.\n");
+ abort();
+ }
if (memcmp(msg->data, bsc_cr_patched, sizeof(bsc_cr_patched)) != 0) {
fprintf(stderr, "Failed to patch the BSC CR msg.\n");
abort();