summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore/src/gsm/lapd_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/libosmocore/src/gsm/lapd_core.c')
-rw-r--r--src/shared/libosmocore/src/gsm/lapd_core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shared/libosmocore/src/gsm/lapd_core.c b/src/shared/libosmocore/src/gsm/lapd_core.c
index b1b5a1ba..fb79a2f0 100644
--- a/src/shared/libosmocore/src/gsm/lapd_core.c
+++ b/src/shared/libosmocore/src/gsm/lapd_core.c
@@ -1731,7 +1731,15 @@ static int lapd_data_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
struct lapd_datalink *dl = lctx->dl;
struct msgb *msg = dp->oph.msg;
- LOGP(DLLAPD, LOGL_INFO, "writing message to send-queue\n");
+ if (msgb_l3len(msg) == 0) {
+ LOGP(DLLAPD, LOGL_ERROR,
+ "writing an empty message is not possible.\n");
+ msgb_free(msg);
+ return -1;
+ }
+
+ LOGP(DLLAPD, LOGL_INFO,
+ "writing message to send-queue: l3len: %d\n", msgb_l3len(msg));
/* Write data into the send queue */
msgb_enqueue(&dl->send_queue, msg);