diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-08-27 22:06:24 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-08-29 02:02:10 +0200 |
commit | 193c1e3ab09af9fd9ed970274af8f0872c9696f6 (patch) | |
tree | 93cd68efdd92d5bdc778e55efbbcfe9e461a60c8 /include/osmocom/bsc/gsm_data.h | |
parent | e23e1aeec2206e56cb4bd3f0bffb39eef44c0e41 (diff) |
lchan_fsm: safer 'concluded' flag
The flag lchan->activate.concluded prevents entering the
lchan_on_fully_established()/lchan_on_activation_failure() more than once. So
far it was checked by callers, instead place in the functions themselves.
There is a potential functional change here, since during lchan_fail(), the
concluded flag was set only after entering lchan_on_activation_failure(). Now
it is already set at the start and prevents multiple re-entry beyond doubt.
This patch is not a result of an actual observed faulty behavior, just from
reading the code and seeing the slight loophole.
Change-Id: I0c906438b05442d66255203eb816453b7193a6d8
Diffstat (limited to 'include/osmocom/bsc/gsm_data.h')
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index b827d0a5a..d6e8954cb 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -505,7 +505,10 @@ struct gsm_lchan { struct { enum lchan_activate_mode activ_for; bool activ_ack; /*< true as soon as RSL Chan Activ Ack is received */ - bool concluded; /*< true as soon as LCHAN_ST_ESTABLISHED is reached */ + /*! 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. */ + bool concluded; bool requires_voice_stream; bool wait_before_switching_rtp; /*< true = requires LCHAN_EV_READY_TO_SWITCH_RTP */ uint16_t msc_assigned_cic; |