laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15849 )

Change subject: send MNCC REL only if MNCC has actually started
......................................................................

send MNCC REL only if MNCC has actually started

Change-Id: I07b2b6c0ee33f5d3e0a060c10cf36d5c7c9f0d9b
---
M include/osmocom/msc/transaction.h
M src/libmsc/gsm_04_08_cc.c
2 files changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index cab0030..61d8c1a 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -103,6 +103,7 @@
                        struct osmo_timer_list timer;
                        struct osmo_timer_list timer_guard;
                        struct gsm_mncc msg;    /* stores 
setup/disconnect/release message */
+                       bool mncc_initiated;    /* Whether an MNCC Release is 
necessary on failure */
                } 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 a90ddce..792ab61 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -244,6 +244,9 @@
        memcpy(data, mncc, sizeof(struct gsm_mncc));

        cc_tx_to_mncc(net, msg);
+       /* trans may be NULL when sending an MNCC error reply upon an invalid 
MNCC request */
+       if (trans)
+               trans->cc.mncc_initiated = true;
 
        return 0;
 }
@@ -278,9 +281,10 @@
                        gsm48_cc_tx_release(trans, &rel);
                }
                /* Ressource unavailable */
-               mncc_release_ind(trans->net, trans, trans->callref,
-                                GSM48_CAUSE_LOC_PRN_S_LU,
-                                GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
+               if (trans->cc.mncc_initiated)
+                       mncc_release_ind(trans->net, trans, trans->callref,
+                                        GSM48_CAUSE_LOC_PRN_S_LU,
+                                        GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
                /* This is a final freeing of the transaction. The MNCC release 
may have triggered the
                 * T308 release timer, but we don't have the luxury of graceful 
CC Release here. */
                gsm48_stop_cc_timer(trans);
@@ -1981,6 +1985,7 @@
        LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s\n", 
get_mncc_name(msg->msg_type));

        gsm48_start_guard_timer(trans);
+       trans->cc.mncc_initiated = true;

        if (trans->msc_a)
                msc_a = trans->msc_a;

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15849
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I07b2b6c0ee33f5d3e0a060c10cf36d5c7c9f0d9b
Gerrit-Change-Number: 15849
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to