diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-29 01:19:42 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-21 12:22:50 +0200 |
commit | 749497eeb3cae13fa2252abcf93468ecd415f063 (patch) | |
tree | 02d6719db109aaf697e28f74a0c2d4ee3b40606d /openbsc/tests | |
parent | 8c78b480f9d1dbb0461f9294891687d43080abf5 (diff) |
nat: Copy the IMSI, then free it or move the context to the connection
Extract the IMSI from the first message as well and safe it
in the connection structure. The problem is that we do not
have this structure at this point, so we will allocate the
imsi as child of the bsc_connection and then move/steal it.
Diffstat (limited to 'openbsc/tests')
-rw-r--r-- | openbsc/tests/bsc-nat/bsc_nat_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index 75bd80384..141775c7a 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -705,6 +705,7 @@ static void test_cr_filter() nat_entry = bsc_nat_acc_lst_entry_create(nat_lst); for (i = 0; i < ARRAY_SIZE(cr_filter); ++i) { + char *imsi; msgb_reset(msg); copy_to_msg(msg, cr_filter[i].data, cr_filter[i].length); @@ -727,7 +728,7 @@ static void test_cr_filter() abort(); } - res = bsc_nat_filter_sccp_cr(bsc, msg, parsed, &contype); + res = bsc_nat_filter_sccp_cr(bsc, msg, parsed, &contype, &imsi); if (res != cr_filter[i].result) { fprintf(stderr, "FAIL: Wrong result %d for test %d.\n", res, i); abort(); @@ -738,6 +739,7 @@ static void test_cr_filter() abort(); } + talloc_steal(parsed, imsi); talloc_free(parsed); } |