oml: Pass all valid state change requests to the model
diff mbox

Message ID 1396271517-7493-1-git-send-email-jerlbeck@sysmocom.de
State Accepted
Headers show

Commit Message

Jacob Erlbeck March 31, 2014, 1:11 p.m. UTC
Currently ADM state change request that tries to set the
administrative state to the current value are immediately ACK'ed.
Beside the caching problem, this could lead the protocol
inconsistencies if two such requests are sent one after the other and
the second arrives before the procedure of the first has finished.

This patch removes the shortcut in oml_rx_chg_adm_state() which
immediately called oml_mo_statechg_ack(mo).

Ticket: OW#1132
Sponsored-by: On-Waves ehf
---
 src/common/oml.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Patch
diff mbox

diff --git a/src/common/oml.c b/src/common/oml.c
index 9ec773b..b7c12f7 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -765,11 +765,10 @@  static int oml_rx_chg_adm_state(struct gsm_bts *bts, struct msgb *msg)
 		return oml_fom_ack_nack(msg, NM_NACK_OBJINST_UNKN);
 
 	/* Step 2: Do some global dependency/consistency checking */
-	if (mo->nm_state.administrative == adm_state) {
-		DEBUGP(DOML, "... automatic ACK, ADM state already was %s\n",
-			get_value_string(abis_nm_adm_state_names, adm_state));
-		return oml_mo_statechg_ack(mo);
-	}
+	if (mo->nm_state.administrative == adm_state)
+		LOGP(DOML, LOGL_NOTICE,
+		     "ADM state already was %s\n",
+		     get_value_string(abis_nm_adm_state_names, adm_state));
 
 	/* Step 3: Ask BTS driver to apply the state chg */
 	return bts_model_chg_adm_state(bts, mo, obj, adm_state);