Change in osmo-bsc[master]: send Immediate Assignment Reject only before Immediate Assignment

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
Tue Nov 27 07:40:29 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11940 )

Change subject: send Immediate Assignment Reject only before Immediate Assignment
......................................................................

send Immediate Assignment Reject only before Immediate Assignment

Set flag lchan->activate.immediate_assignment_sent to true when sending, and
omit a reject after that.

lchan->activate gets completely zeroed in lchan_reset(), which sets that flag
back to false whenever an lchan becomes inactive.

Related: OS#3709
Change-Id: I9ad094d272254d7aee9b0a676201d4ed8cd727ca
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/lchan_fsm.c
2 files changed, 13 insertions(+), 3 deletions(-)

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



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index ba52c99..15158cd 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -501,6 +501,7 @@
 	struct {
 		enum lchan_activate_mode activ_for;
 		bool activ_ack; /*< true as soon as RSL Chan Activ Ack is received */
+		bool immediate_assignment_sent;
 		/*! This flag ensures that when an lchan activation has succeeded, and we have already
 		 * sent ACKs like Immediate Assignment or BSSMAP Assignment Complete, and if other errors
 		 * occur later, e.g. during release, that we don't send a NACK out of context. */
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 71b40c1..5e99239 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -97,9 +97,17 @@
 	switch (activ_for) {
 
 	case FOR_MS_CHANNEL_REQUEST:
-		LOG_LCHAN(lchan, LOGL_NOTICE, "Tx Immediate Assignment Reject (%s)\n",
-			  lchan->last_error ? : "unknown error");
-		rsl_tx_imm_ass_rej(lchan->ts->trx->bts, lchan->rqd_ref);
+		if (lchan->activate.immediate_assignment_sent) {
+			LOG_LCHAN(lchan, LOGL_ERROR,
+				  "lchan activation failed, after Immediate Assignment message was sent (%s)\n",
+				  lchan->last_error ? : "unknown error");
+			/* Likely the MS never showed up. Just tear down the lchan. */
+		} else {
+			/* Failure before Immediate Assignment message, send a reject. */
+			LOG_LCHAN(lchan, LOGL_NOTICE, "Tx Immediate Assignment Reject (%s)\n",
+				  lchan->last_error ? : "unknown error");
+			rsl_tx_imm_ass_rej(lchan->ts->trx->bts, lchan->rqd_ref);
+		}
 		break;
 
 	case FOR_ASSIGNMENT:
@@ -713,6 +721,7 @@
 			return;
 		}
 		LOG_LCHAN(lchan, LOGL_DEBUG, "Tx RR Immediate Assignment\n");
+		lchan->activate.immediate_assignment_sent = true;
 		break;
 
 	case FOR_ASSIGNMENT:

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9ad094d272254d7aee9b0a676201d4ed8cd727ca
Gerrit-Change-Number: 11940
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181127/a9c8a306/attachment.htm>


More information about the gerrit-log mailing list