From 44a0e0fc088eeb814e94957fa2525271a26e8cf0 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 4 Dec 2020 14:22:18 +0100 Subject: oml: Delay configuring NSVC until BTS features are negotiated This is needed in order to to proper feature support verification for IPv6 when configuring the NSVC. Before this patch, there could be a race condition where NSVC FSM checked for BTS feature BTS_FEAT_IPV6_NSVC before it was negotiated through BTS Get Attributes (Ack). Fixes: OS#4870 Change-Id: I7c207eee0e331995ae04acec014fbd13d4d16280 --- include/osmocom/bsc/bts.h | 5 +++++ include/osmocom/bsc/nm_common_fsm.h | 1 + 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index fd968fa1c..2b05418fe 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -585,6 +585,11 @@ char *get_model_oml_status(const struct gsm_bts *bts); /* reset the state of all MO in the BTS */ void gsm_bts_mo_reset(struct gsm_bts *bts); +static inline bool gsm_bts_features_negotiated(struct gsm_bts *bts) +{ + return bts->mo.get_attr_rep_received || bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; +} + /* dependency handling */ void bts_depend_mark(struct gsm_bts *bts, int dep); void bts_depend_clear(struct gsm_bts *bts, int dep); diff --git a/include/osmocom/bsc/nm_common_fsm.h b/include/osmocom/bsc/nm_common_fsm.h index bceefbe73..89ec863aa 100644 --- a/include/osmocom/bsc/nm_common_fsm.h +++ b/include/osmocom/bsc/nm_common_fsm.h @@ -36,6 +36,7 @@ enum nm_fsm_events { NM_EV_OPSTART_NACK, NM_EV_OML_DOWN, NM_EV_FORCE_LOCK, /* Only supported by RadioCarrier so far */ + NM_EV_FEATURE_NEGOTIATED, /* Sent by BTS to NSVC MO */ }; extern const struct value_string nm_fsm_event_names[]; -- cgit v1.2.3