Change in osmo-msc[master]: Use libosmocore to function to parse cipher mode reject cause

Max gerrit-no-reply at lists.osmocom.org
Mon Nov 19 14:06:41 UTC 2018


Max has uploaded this change for review. ( https://gerrit.osmocom.org/11832


Change subject: Use libosmocore to function to parse cipher mode reject cause
......................................................................

Use libosmocore to function to parse cipher mode reject cause

This allow us to handle both regular and extended cause transparently.

Change-Id: I7742ac41dd0642a5a40ce79d23250f8d9e6ae556
Related: OS#3187
---
M src/libmsc/a_iface_bssap.c
1 file changed, 9 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/11832/1

diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index f24fb05..14bdcea 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -427,6 +427,7 @@
 static int bssmap_rx_ciph_rej(struct gsm_subscriber_connection *conn,
 			      struct msgb *msg, struct tlv_parsed *tp)
 {
+	int rc;
 	enum gsm0808_cause cause;
 	struct rate_ctr_group *msc = conn->network->msc_ctrs;
 
@@ -437,10 +438,15 @@
 		return -EINVAL;
 	}
 
-	rate_ctr_inc(&msc->ctr[MSC_CTR_BSSMAP_CIPHER_MODE_REJECT]);
+	rc = gsm0808_get_cipher_reject_cause(tp);
+	if (rc < 0) {
+		LOGPCONN(conn, LOGL_ERROR, "failed (%s) to extract Cause from Cipher mode reject: %s\n",
+			 strerror(-rc), msgb_hexdump(msg));
+		return rc;
+	}
 
-	/* FIXME: add support for 2-byte Cause values using libosmocore functions */
-	cause = *TLVP_VAL(tp, GSM0808_IE_CAUSE);
+	rate_ctr_inc(&msc->ctr[MSC_CTR_BSSMAP_CIPHER_MODE_REJECT]);
+	cause = (enum gsm0808_cause)rc;
 	LOGPCONN(conn, LOGL_NOTICE, "Cipher mode rejection cause: %s\n", gsm0808_cause_name(cause));
 
 	/* FIXME: Can we do something meaningful here? e.g. report to the

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7742ac41dd0642a5a40ce79d23250f8d9e6ae556
Gerrit-Change-Number: 11832
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181119/2f1f7106/attachment.html>


More information about the gerrit-log mailing list