Change in osmo-bsc[master]: bsc_subscr_conn_fsm: use proper cause values in SAPI N REJECT

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

fixeria gerrit-no-reply at lists.osmocom.org
Wed Aug 26 11:51:51 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19826 )


Change subject: bsc_subscr_conn_fsm: use proper cause values in SAPI N REJECT
......................................................................

bsc_subscr_conn_fsm: use proper cause values in SAPI N REJECT

As 3GPP TS 48.058 clearly states, an RLL RELease INDication is only
sent if the datalink is released by the MS.  Thre's no cause value
giving further diagnostics, but if the MS releases the link, it is
clearly not the BSS's fault, and hence "BSS not equipped" is wrong.

Change-Id: I38222e60071841abcd06046a472ddb35907164a4
Related: OS#4728
---
M include/osmocom/bsc/gsm_08_08.h
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/gsm_08_08.c
M tests/bsc/bsc_test.c
M tests/handover/handover_test.c
5 files changed, 15 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/19826/1

diff --git a/include/osmocom/bsc/gsm_08_08.h b/include/osmocom/bsc/gsm_08_08.h
index e55bf2c..80da297 100644
--- a/include/osmocom/bsc/gsm_08_08.h
+++ b/include/osmocom/bsc/gsm_08_08.h
@@ -6,7 +6,7 @@
 
 struct gsm_subscriber_connection;
 
-void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci);
+void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci, enum gsm0808_cause cause);
 void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr);
 int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint16_t chosen_channel);
 void bsc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg);
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 4f559fe..6871c4c 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -1036,9 +1036,14 @@
 		rsl_data_request(msg, OBSC_LINKID_CB(msg));
 		break;
 	case BSC_RLLR_IND_REL_IND:
+		bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg),
+				  GSM0808_CAUSE_MS_NOT_EQUIPPED);
+		msgb_free(msg);
+		break;
 	case BSC_RLLR_IND_ERR_IND:
 	case BSC_RLLR_IND_TIMEOUT:
-		bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg));
+		bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg),
+				  GSM0808_CAUSE_BSS_NOT_EQUIPPED);
 		msgb_free(msg);
 		break;
 	}
@@ -1078,7 +1083,7 @@
 		rc = rll_establish(msg->lchan, sapi, rll_ind_cb, msg);
 		if (rc) {
 			msgb_free(msg);
-			bsc_sapi_n_reject(conn, link_id);
+			bsc_sapi_n_reject(conn, link_id, GSM0808_CAUSE_BSS_NOT_EQUIPPED);
 			goto failed_to_send;
 		}
 		return;
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index e5457c4..59032d6 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -60,7 +60,8 @@
 }
 
 /*! BTS->MSC: tell MSC a SAPI was not established. */
-void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci)
+void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn,
+		       uint8_t dlci, enum gsm0808_cause cause)
 {
 	int rc;
 	struct msgb *resp;
@@ -68,8 +69,9 @@
 	if (!msc_connected(conn))
 		return;
 
-	LOGP(DMSC, LOGL_NOTICE, "Tx MSC SAPI N REJECT DLCI=0x%02x\n", dlci);
-	resp = gsm0808_create_sapi_reject(dlci);
+	LOGP(DMSC, LOGL_NOTICE, "Tx MSC SAPI N REJECT (dlci=0x%02x, cause='%s')\n",
+	     dlci, gsm0808_cause_name(cause));
+	resp = gsm0808_create_sapi_reject_cause(dlci, cause);
 	rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_SAPI_N_REJECT]);
 	rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_TX_SCCP, resp);
 	if (rc != 0)
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 86d8972..d999608 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -223,7 +223,7 @@
 	OSMO_ASSERT(0);
 }
 
-void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci) {}
+void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci, enum gsm0808_cause cause) {}
 void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr) {}
 int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint16_t chosen_channel)
 { return 0; }
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 31d4b6f..78e8daf 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1794,7 +1794,7 @@
 void trau_send_frame() {}
 int osmo_bsc_sigtran_send(struct gsm_subscriber_connection *conn, struct msgb *msg) { return 0; }
 int osmo_bsc_sigtran_open_conn(struct gsm_subscriber_connection *conn, struct msgb *msg) { return 0; }
-void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci) {}
+void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci, enum gsm0808_cause cause) {}
 void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr) {}
 int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint16_t chosen_channel)
 { return 0; }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19826
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I38222e60071841abcd06046a472ddb35907164a4
Gerrit-Change-Number: 19826
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200826/d48e4e90/attachment.htm>


More information about the gerrit-log mailing list