From fa20c944569e4eaf79370672ff571cb5330ff1b2 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 16 May 2010 16:51:31 +0800 Subject: [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. --- openbsc/tests/bsc-nat/bsc_nat_test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'openbsc/tests') 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(); -- cgit v1.2.3