aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-27 12:30:12 +0100
committerHarald Welte <laforge@gnumonks.org>2010-12-27 12:45:22 +0100
commit38ee8da909d926a6bd428011fb83edf18d39168d (patch)
tree876770ffeefa4744e78008ad331d48a002b5c421 /openbsc/src
parent41bbf6b12821ff43fbfde88d083962143cfae104 (diff)
bsc: Some S_LCHAN signals don't provide an lchan
Check the signal and only continue if it is any of the signals we want to handle. In the case of measurement reports we would cast some random code to a lchan.
Diffstat (limited to 'openbsc/src')
-rw-r--r--openbsc/src/bsc_api.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 13c29aac2..a7fd7f986 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -587,6 +587,20 @@ static int bsc_handle_lchan_signal(unsigned int subsys, unsigned int signal,
if (subsys != SS_LCHAN)
return 0;
+ /*
+ * Check if it is any of the signals we handle. We do want
+ * to do this early as we will need to check the lchan and
+ * the bsc api in it.
+ */
+ switch (signal) {
+ case S_LCHAN_UNEXPECTED_RELEASE:
+ case S_LCHAN_ACTIVATE_ACK:
+ case S_LCHAN_ACTIVATE_NACK:
+ break;
+ default:
+ return -1;
+ }
+
lchan = (struct gsm_lchan *)signal_data;
if (!lchan || !lchan->conn)
return 0;