diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-05 11:38:37 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-05 11:38:37 +0800 |
commit | 49ab278b6fe05be5e2cf3e9be9dee7e4b81b3870 (patch) | |
tree | 003b5887c489bd6ffa208aee9106a29d53b93930 /openbsc/src/bsc_api.c | |
parent | 952db280bd3d8a01a3539ca983dd77d558d0fad9 (diff) |
bsc_api: Only forward L3 messages when the channel is active
Avoid forwarding messages from a channel that is already being
closed. Harald has forwarded a crash report where this was failing.
Diffstat (limited to 'openbsc/src/bsc_api.c')
-rw-r--r-- | openbsc/src/bsc_api.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c index 856dc615c..2cb3b1a96 100644 --- a/openbsc/src/bsc_api.c +++ b/openbsc/src/bsc_api.c @@ -29,6 +29,7 @@ #include <openbsc/abis_rsl.h> #include <openbsc/chan_alloc.h> #include <openbsc/handover.h> +#include <openbsc/debug.h> #include <osmocore/talloc.h> @@ -94,6 +95,12 @@ int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id) struct gsm_lchan *lchan; lchan = msg->lchan; + if (lchan->state != LCHAN_S_ACTIVE) { + LOGP(DRSL, LOGL_ERROR, "Got data in non active state. discarding.\n"); + return -1; + } + + if (lchan->conn) { api->dtap(lchan->conn, msg); } else { |