Change in libosmocore[master]: gprs_ns: Add missing NSVCI IE to NS-BLOCK-ACK message

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
Wed Feb 20 18:14:36 UTC 2019


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

Change subject: gprs_ns: Add missing NSVCI IE to NS-BLOCK-ACK message
......................................................................

gprs_ns: Add missing NSVCI IE to NS-BLOCK-ACK message

According to Section 9.2.4 of 3GPP TS 48.016, the NS-BLOCK-ACK PDU has a
mandatory NSVCI IE which we so far were missing.

Change-Id: Ie7205e99d57f1e42d941f1be2460d8c9f46aadfe
Closes: OS#3808
---
M src/gb/gprs_ns.c
1 file changed, 29 insertions(+), 1 deletion(-)

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



diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index 47c2529..54964d3 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -547,6 +547,34 @@
 	return gprs_ns_tx(nsvc, msg);
 }
 
+/*! Transmit a NS-BLOCK-ACK on a given NS-VC
+ *  \param[in] nsvc NS-VC on which the NS-BLOCK is to be transmitted
+ *  \returns 0 in case of success
+ */
+static int gprs_ns_tx_block_ack(struct gprs_nsvc *nsvc)
+{
+	struct msgb *msg;
+	struct gprs_ns_hdr *nsh;
+	uint16_t nsvci = osmo_htons(nsvc->nsvci);
+
+	log_set_context(LOG_CTX_GB_NSVC, nsvc);
+
+	msg = gprs_ns_msgb_alloc();
+	if (!msg)
+		return -ENOMEM;
+
+	LOGP(DNS, LOGL_INFO, "NSEI=%u Tx NS BLOCK ACK (NSVCI=%u)\n", nsvc->nsei, nsvc->nsvci);
+
+	/* be conservative and mark it as blocked even now! */
+	msg->l2h = msgb_put(msg, sizeof(*nsh));
+	nsh = (struct gprs_ns_hdr *) msg->l2h;
+	nsh->pdu_type = NS_PDUT_BLOCK_ACK;
+
+	msgb_tvlv_put(msg, NS_IE_VCI, 2, (uint8_t *) &nsvci);
+
+	return gprs_ns_tx(nsvc, msg);
+}
+
 /*! Transmit a NS-UNBLOCK on a given NS-VC
  *  \param[in] nsvc NS-VC on which the NS-UNBLOCK is to be transmitted
  *  \returns 0 in case of success
@@ -1122,7 +1150,7 @@
 	ns_osmo_signal_dispatch(nsvc, S_NS_BLOCK, *cause);
 	rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_BLOCKED]);
 
-	return gprs_ns_tx_simple(nsvc, NS_PDUT_BLOCK_ACK);
+	return gprs_ns_tx_block_ack(nsvc);
 }
 
 int gprs_ns_vc_create(struct gprs_ns_inst *nsi, struct msgb *msg,

-- 
To view, visit https://gerrit.osmocom.org/12969
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: Ie7205e99d57f1e42d941f1be2460d8c9f46aadfe
Gerrit-Change-Number: 12969
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
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/20190220/9e356e05/attachment.htm>


More information about the gerrit-log mailing list