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.
This commit is contained in:
Holger Hans Peter Freyther 2010-07-05 11:38:37 +08:00
parent 952db280bd
commit 49ab278b6f
1 changed files with 7 additions and 0 deletions

View File

@ -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 {