diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-12-27 12:30:12 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-12-27 12:30:12 +0100 |
commit | 9ae7b29e3a74b3c7ddf7781ae0b9ebd4cd8efddb (patch) | |
tree | b1536648a6f403d4853860dc270d36b5bf8c9183 | |
parent | 59f787a4c1ed23883eb31bf96d5b5229b3214b6a (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.
-rw-r--r-- | openbsc/src/bsc_api.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c index 35babc319..8b3ff8f3a 100644 --- a/openbsc/src/bsc_api.c +++ b/openbsc/src/bsc_api.c @@ -606,6 +606,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; |