cbsp: Fix osmo_cbsp_recv_buffered() for KEEP-ALIVE-COMPLETE
We used to suppress/drop any "zero length" messages, but we didn't
include the header when computing the length. However, in CBSP there
are messages (at least KEEP-ALIVE-COMPLETE) which only consist of the
header without any information elements. We cannot simply drop such
messages.
This also fixes the return value of osmo_cbsp_recv_buffered() to be
the total number of received octets (including the header).
Change-Id: Ib620128a167cb77f061ee57e8f8ad707b96b1c0d
diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c
index 6ddef33..2037f7c 100644
--- a/src/gsm/cbsp.c
+++ b/src/gsm/cbsp.c
@@ -1460,12 +1460,7 @@
}
}
/* else: complete message received */
- rc = msgb_l2len(msg);
- if (rc == 0) {
- /* drop empty message */
- rc = -EAGAIN;
- goto discard_msg;
- }
+ rc = msgb_length(msg);
if (tmp_msg)
*tmp_msg = NULL;
*rmsg = msg;