aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-16 06:41:09 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-16 06:41:09 +0800
commiteea5a1bcd6f520a2a01544e25417bf54e4c50d70 (patch)
treea320e54474d86798665f429da8c3223f6fb7b28b /openbsc/src/nat
parent4fcce9ea1919505d4fe1553a56506b5580b99091 (diff)
nat: Fix a crash when a BSC disconnects while a rejected IMSI
When we reject the IMSI we do not have the msc_con set on the SCCP connection, but we do have a remote_ref. So the nat_send_rlsd will end up with a crash due the msc_con being zero. Fix the crash by only sending a released to the MSC when the connection is not local.
Diffstat (limited to 'openbsc/src/nat')
-rw-r--r--openbsc/src/nat/bsc_nat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index dde9196f3..23b811117 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -329,6 +329,7 @@ static void bsc_send_con_release(struct bsc_connection *bsc, struct sccp_connect
queue_for_msc(con->msc_con, rlsd);
}
con->con_local = 1;
+ con->msc_con = NULL;
/* 2. release the BSC side */
if (con->con_type == NAT_CON_TYPE_LU) {
@@ -676,7 +677,7 @@ void bsc_close_connection(struct bsc_connection *connection)
if (ctr)
rate_ctr_inc(ctr);
- if (sccp_patch->has_remote_ref)
+ if (sccp_patch->has_remote_ref && !sccp_patch->con_local)
nat_send_rlsd(sccp_patch);
sccp_connection_destroy(sccp_patch);
}