From 49ab278b6fe05be5e2cf3e9be9dee7e4b81b3870 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 5 Jul 2010 11:38:37 +0800 Subject: [PATCH] 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. --- openbsc/src/bsc_api.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 #include #include +#include #include @@ -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 {