diff options
Diffstat (limited to 'openbsc/tests/bsc-nat')
-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 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(); |