diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-16 16:51:31 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-16 20:45:15 +0800 |
commit | 60a2f4a7e6d9dbcd76eb59ed943a415303247265 (patch) | |
tree | 39ab2fdb04c5a2b7f2dd904133691241b6bf46b5 /openbsc/tests | |
parent | 797b9f0af07d8e1ef1dbec67995b69aa07093e5d (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')
-rw-r--r-- | openbsc/tests/bsc-nat/bsc_nat_test.c | 10 |
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 094b87d63..8f3f358fc 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(); |