Change in libosmocore[master]: Fix BSSMAP length generated by gsm0808_create_clear_command2()

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Feb 18 13:11:05 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12924 )

Change subject: Fix BSSMAP length generated by gsm0808_create_clear_command2()
......................................................................

Fix BSSMAP length generated by gsm0808_create_clear_command2()

In Change-Id Id8a75e1da2d5f520064666e4ee413d1c91da6ae3 we recently
introduced adding the "CSFB INDICATOR" IE to the CLEAR COMMAND,
but we did so with a wrong length value.

Change-Id: I4d07d25fb03ca0f89fd7b94226c54309c77a010a
Closes: OS#3805
Related: OS#2778
---
M src/gsm/gsm0808.c
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 2907255..86b6c05 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -201,13 +201,19 @@
  *  \returns callee-allocated msgb with BSSMAP Clear Command message. */
 struct msgb *gsm0808_create_clear_command2(uint8_t cause, bool csfb_ind)
 {
-	struct msgb *msg = gsm0808_create_clear_command(cause);
+	struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
+					       "bssmap: clear command");
 	if (!msg)
 		return NULL;
 
+	msgb_v_put(msg, BSS_MAP_MSG_CLEAR_CMD);
+	gsm0808_enc_cause(msg, cause);
+
 	if (csfb_ind)
 		msgb_v_put(msg, GSM0808_IE_CSFB_INDICATION);
 
+	msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
+
 	return msg;
 }
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4d07d25fb03ca0f89fd7b94226c54309c77a010a
Gerrit-Change-Number: 12924
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190218/57c33bec/attachment.htm>


More information about the gerrit-log mailing list