summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-11-02 16:12:03 +0100
committerMax <msuraev@sysmocom.de>2018-11-02 16:12:03 +0100
commit2b4a67a412ace101f2e3fe893f8b2724c6fd5062 (patch)
treeddfe0f76cab30410ef8c25a2fcb3fb2a5530c030
parent1a146c89e2a27dee11326593697790823141488e (diff)
Update cipher reject function
* add note about (yet) unsupported standard feature * use enum constant instead of hex value Change-Id: I5cc5fc1ae8d5474dbc8d3385a493adf6420a3c98 Related: OS#3187
-rw-r--r--src/gsm/gsm0808.c1
-rw-r--r--tests/gsm0808/gsm0808_test.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 9ccca4d6..e5c3e30a 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -275,6 +275,7 @@ struct msgb *gsm0808_create_cipher_reject(uint8_t cause)
return NULL;
msgb_v_put(msg, BSS_MAP_MSG_CIPHER_MODE_REJECT);
+ /* FIXME: support 2-byte cause value as per 3GPP TS 08.08 ยง3.2.2.5 */
msgb_tlv_put(msg, GSM0808_IE_CAUSE, 1, &cause);
msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg));
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 0b2794f1..7111db9b 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -248,7 +248,7 @@ static void test_create_cipher_reject()
struct msgb *msg;
printf("Testing creating Cipher Reject\n");
- msg = gsm0808_create_cipher_reject(0x23);
+ msg = gsm0808_create_cipher_reject(GSM0808_CAUSE_CCCH_OVERLOAD);
VERIFY(msg, res, ARRAY_SIZE(res));
msgb_free(msg);
}