Change in osmo-msc[master]: transaction: clarify magic 0xff transaction ID

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Thu Feb 14 22:43:51 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/12901 )

Change subject: transaction: clarify magic 0xff transaction ID
......................................................................

transaction: clarify magic 0xff transaction ID

Change-Id: I2d3a6334f49989bedbb1430d26ffad8b61dfd873
---
M include/osmocom/msc/transaction.h
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_09_11.c
M src/libmsc/transaction.c
4 files changed, 8 insertions(+), 4 deletions(-)

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



diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index c5c740c..5e8d637 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -9,6 +9,9 @@
 #include <osmocom/gsm/gsm0411_smc.h>
 #include <osmocom/gsm/gsm0411_smr.h>
 
+/* Used for late TID assignment */
+#define TRANS_ID_UNASSIGNED 0xff
+
 enum bridge_state {
 	BRIDGE_STATE_NONE,
 	BRIDGE_STATE_LOOPBACK_PENDING,
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index b84fd03..98c2aa3 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -617,7 +617,7 @@
 	gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
 
 	/* transaction id must not be assigned */
-	if (trans->transaction_id != 0xff) { /* unasssigned */
+	if (trans->transaction_id != TRANS_ID_UNASSIGNED) {
 		DEBUGP(DCC, "TX Setup with assigned transaction. "
 			"This is not allowed!\n");
 		/* Temporarily out of order */
@@ -1928,7 +1928,8 @@
 						GSM48_CC_CAUSE_DEST_OOO);
 		}
 		/* Create transaction */
-		trans = trans_alloc(net, vsub, GSM48_PDISC_CC, 0xff, data->callref);
+		trans = trans_alloc(net, vsub, GSM48_PDISC_CC,
+				    TRANS_ID_UNASSIGNED, data->callref);
 		if (!trans) {
 			LOGP(DCC, LOGL_ERROR, "No memory for trans.\n");
 			vlr_subscr_put(vsub);
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 08721d4..d2ad0b7 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -296,7 +296,7 @@
 
 	/* Allocate a new transaction */
 	trans = trans_alloc(net, vsub, GSM48_PDISC_NC_SS,
-		0xff, gsup_msg->session_id);
+		TRANS_ID_UNASSIGNED, gsup_msg->session_id);
 	if (!trans) {
 		LOGP(DMM, LOGL_ERROR, " -> No memory for trans\n");
 		return NULL;
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 237191d..23880aa 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -196,7 +196,7 @@
 	llist_for_each_entry(trans, &net->trans_list, entry) {
 		if (trans->vsub != vsub ||
 		    trans->protocol != protocol ||
-		    trans->transaction_id == 0xff)
+		    trans->transaction_id == TRANS_ID_UNASSIGNED)
 			continue;
 		used_tid_bitmask |= (1 << trans->transaction_id);
 	}

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d3a6334f49989bedbb1430d26ffad8b61dfd873
Gerrit-Change-Number: 12901
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190214/87773160/attachment.htm>


More information about the gerrit-log mailing list