aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-01-02 20:50:47 +0100
committerHarald Welte <laforge@osmocom.org>2021-01-03 14:18:58 +0100
commitfdd71c822a6f59075a9f069a505264416a7d5945 (patch)
tree1dd10cf53c6f4124ed9152f746c2322da8474c96
parent64b9407c4e3cefaeff2b76b8e4ce3f8d55b5986a (diff)
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
-rw-r--r--src/gsm/cbsp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gsm/cbsp.c b/src/gsm/cbsp.c
index 6ddef33f..2037f7c7 100644
--- a/src/gsm/cbsp.c
+++ b/src/gsm/cbsp.c
@@ -1460,12 +1460,7 @@ int osmo_cbsp_recv_buffered(void *ctx, int fd, struct msgb **rmsg, struct msgb *
}
}
/* 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;