nat: remove is called on already patched connections..

Fix the test to search for the original message instead
of the already patched one that should not find any items
anyway.

The remove is called on already patched connections so we
need to match it with the patch reference count.
This commit is contained in:
Holger Hans Peter Freyther 2010-04-05 21:44:51 +02:00
parent 560af50422
commit 9d51855f66
2 changed files with 5 additions and 5 deletions

View File

@ -129,11 +129,7 @@ void remove_sccp_src_ref(struct bsc_connection *bsc, struct msgb *msg, struct bs
llist_for_each_entry(conn, &bsc->nat->sccp_connections, list_entry) {
if (memcmp(parsed->src_local_ref,
&conn->real_ref, sizeof(conn->real_ref)) == 0) {
/* two BSCs have used the same real ref... this is why we rewrite it */
if (bsc != conn->bsc)
continue;
&conn->patched_ref, sizeof(conn->patched_ref)) == 0) {
sccp_connection_destroy(conn);
return;

View File

@ -290,6 +290,10 @@ static void test_contrack()
abort();
}
remove_sccp_src_ref(con, msg, parsed);
talloc_free(parsed);
copy_to_msg(msg, bsc_rlc, sizeof(bsc_rlc));
parsed = bsc_nat_parse(msg);
con_found = patch_sccp_src_ref_to_msc(msg, parsed, nat);
/* verify that it is gone */