From a8929fdb5642c86c23a615e4e00a78269366e846 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 26 Oct 2017 17:19:50 +0200 Subject: 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 --- include/osmocom/sigtran/mtp_sap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') 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 @@ enum osmo_mtp_prim_type { 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; -- cgit v1.2.3