Change in libosmocore[master]: cbsp: Fix osmo_cbsp_recv_buffered() for KEEP-ALIVE-COMPLETE

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Jan 2 21:24:04 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21918 )


Change subject: cbsp: Fix osmo_cbsp_recv_buffered() for KEEP-ALIVE-COMPLETE
......................................................................

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
---
M src/gsm/cbsp.c
1 file changed, 1 insertion(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/21918/1

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;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21918
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib620128a167cb77f061ee57e8f8ad707b96b1c0d
Gerrit-Change-Number: 21918
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210102/5c94f634/attachment.htm>


More information about the gerrit-log mailing list