[MERGED] libosmo-sccp[master]: sccp_scrc: fix Network Indicator in SIO composition

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
Thu Oct 26 15:38:33 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: sccp_scrc: fix Network Indicator in SIO composition
......................................................................


sccp_scrc: fix Network Indicator in SIO composition

Since the NI is in bits DC, not BA, it needs to be shifted by 6, not 4, to end
up in the two most significant bits. Also, NI is two bits wide, hence & 0x3.
(The m3ua.c side of this is already correct.)

See ITU-T Recommendation Q.704 (07/96), 14.2 "Service information octet".

Before this patch, NI was always sent as 00 == International regardless of the
VTY configuration.

This patch was verified to work by a wireshark trace of osmo-bsc connecting to
osmo-msc, showing the NI decoded as configured by an osmo-bsc.cfg file in the
BSSMAP Reset message MTP 3 / Protocol data.

Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b
---
M include/osmocom/sigtran/mtp_sap.h
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/sigtran/mtp_sap.h b/include/osmocom/sigtran/mtp_sap.h
index 120ae91..0ae8592 100644
--- a/include/osmocom/sigtran/mtp_sap.h
+++ b/include/osmocom/sigtran/mtp_sap.h
@@ -31,7 +31,7 @@
 	OSMO_MTP_PRIM_STATUS,
 };
 
-#define MTP_SIO(service, net_ind)	(((net_ind & 0xF) << 4) | (service & 0xF))
+#define MTP_SIO(service, net_ind)	(((net_ind & 0x3) << 6) | (service & 0xF))
 
 struct osmo_mtp_transfer_param {
 	uint32_t opc;

-- 
To view, visit https://gerrit.osmocom.org/4431
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7bb4eb6518a1e0d74313bda776d2a6acd0b02e1b
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list