aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-01-14 03:04:56 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-09 02:28:32 +0200
commite6c1876366bbbe21e36cc6784c65def56ea96fc6 (patch)
tree536135f0d3f967b9c92d20ce562ee1de12c7f278
parent219e5f53642abe27a7b261715aa663c8e5b5b547 (diff)
MNCC: do not send REL_IND twice
Add trans.cc.mncc_release_sent and skip MNCC_REL_IND if already true. Related: SYS#5066 Change-Id: I449e1e4139af5f41da08ba9f6815ef74d8e13897
-rw-r--r--include/osmocom/msc/transaction.h1
-rw-r--r--src/libmsc/gsm_04_08_cc.c16
-rw-r--r--src/libmsc/msc_a.c2
3 files changed, 19 insertions, 0 deletions
diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index 8fae86a4e..e422c111c 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -107,6 +107,7 @@ struct gsm_trans {
struct osmo_lcls *lcls;
/* Track codec choices from BSS and remote call leg */
struct codec_filter codecs;
+ bool mncc_release_sent; /* Mark when special error handling already did MNCC rel */
} cc;
struct {
struct gsm411_smc_inst smc_inst;
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index fe5bf4ac7..3f3dc86ec 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -237,6 +237,22 @@ static int _mncc_recvmsg(const char *file, int line, struct gsm_network *net, st
struct msgb *msg;
unsigned char *data;
+ switch (msg_type) {
+ case MNCC_DISC_IND:
+ case MNCC_REL_IND:
+ if (trans) {
+ if (trans->cc.mncc_release_sent) {
+ LOG_TRANS_CAT_SRC(trans, DMNCC, file, line, LOGL_DEBUG,
+ "Already released, skipping tx %s\n", get_mncc_name(msg_type));
+ return 0;
+ }
+ trans->cc.mncc_release_sent = true;
+ }
+ break;
+ default:
+ break;
+ }
+
LOG_TRANS_CAT_SRC(trans, DMNCC, file, line, LOGL_DEBUG, "tx %s\n", get_mncc_name(msg_type));
mncc->msg_type = msg_type;
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 7d8a4c28a..5b61e4a1b 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1835,6 +1835,8 @@ static int msc_a_start_assignment(struct msc_a *msc_a, struct gsm_trans *cc_tran
OSMO_ASSERT(!msc_a->cc.active_trans);
msc_a->cc.active_trans = cc_trans;
+ cc_trans->cc.mncc_release_sent = false;
+
OSMO_ASSERT(cc_trans && cc_trans->type == TRANS_CC);
cl = msc_a_ensure_call_leg(msc_a, cc_trans);
if (!cl)