pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/43799?usp=email )

Change subject: sigtran: N-DISCONNECT.req: Use proper SCCP-User release reason
......................................................................

sigtran: N-DISCONNECT.req: Use proper SCCP-User release reason

Until recently, libosmo-sigtran was incorrectly expecting low-level
wire-format cause in N-DISCONNECT.req. Nowadays it supports specific
reason values in the SCCP-User SAP, so use those instead.

Related: OS#2601
Change-Id: I17bceb7dbd6d8198a07c232eee8aebb7b89a3bf2
---
M TODO-RELEASE
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/lb.c
M src/osmo-bsc/osmo_bsc_sigtran.c
4 files changed, 22 insertions(+), 6 deletions(-)

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




diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..b6d61b1 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
 # If any interfaces have been added since the last public release: c:r:a + 1.
 # If any interfaces have been removed or changed since the last public 
release: c:r:0.
 #library       what                    description / commit summary line
+libosmo-sigtran >2.3.0                  OSMO_SCCP_REL_REASON_NSU_*
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c 
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index a2a1eb7..4ea0053 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -445,7 +445,11 @@
                                 
osmo_sccp_addr_dump(&scu_prim->u.connect.calling_addr));
                        /* We cannot find a way to the sccp_user without the 
MSC, so we cannot
                         * use osmo_sccp_tx_disconn() :( */
-                       //osmo_sccp_tx_disconn(conn->sccp.msc->a.sccp_user, 
scu_prim->u.connect.conn_id, &scu_prim->u.connect.called_addr, 0);
+                       /* osmo_sccp_tx_disconn(conn->sccp.msc->a.sccp_user,
+                        *                      scu_prim->u.connect.conn_id,
+                        *                      
&scu_prim->u.connect.called_addr,
+                        *                      
OSMO_SCCP_REL_REASON_NSU_DISC_NORMAL);
+                        */
                        osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL);
                        return;
                }
@@ -1148,8 +1152,10 @@
        if (conn->sccp.state != SUBSCR_SCCP_ST_NONE) {
                LOGPFSML(fi, LOGL_DEBUG, "Disconnecting SCCP\n");
                struct bsc_msc_data *msc = conn->sccp.msc;
-               /* FIXME: include a proper cause value / error message? */
-               osmo_sccp_tx_disconn(msc->a.sccp_user, conn->sccp.conn.conn_id, 
&msc->a.bsc_addr, 0);
+               osmo_sccp_tx_disconn(msc->a.sccp_user,
+                                    conn->sccp.conn.conn_id,
+                                    &msc->a.bsc_addr,
+                                    OSMO_SCCP_REL_REASON_NSU_DISC_NORMAL);
                conn->sccp.state = SUBSCR_SCCP_ST_NONE;
        }
        if (conn->sccp.conn.conn_id != SCCP_CONN_ID_UNSET && conn->sccp.msc) {
diff --git a/src/osmo-bsc/lb.c b/src/osmo-bsc/lb.c
index aac34a8..05a1103 100644
--- a/src/osmo-bsc/lb.c
+++ b/src/osmo-bsc/lb.c
@@ -302,7 +302,10 @@
                 * direction: N-CONNECT from SMLC -> BSC, which should never 
happen. */
                LOGP(DLCS, LOGL_ERROR, "N-CONNECT.ind(X->%u): inbound connect 
from SMLC is not expected to happen\n",
                     scu_prim->u.connect.conn_id);
-               rc = osmo_sccp_tx_disconn(scu, scu_prim->u.connect.conn_id, 
&scu_prim->u.connect.called_addr, 0);
+               rc = osmo_sccp_tx_disconn(scu,
+                                         scu_prim->u.connect.conn_id,
+                                         &scu_prim->u.connect.called_addr,
+                                         
OSMO_SCCP_REL_REASON_NSU_CREF_END_USER_ORIGIN);
                break;

        case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM):
@@ -428,7 +431,10 @@
                return;
        OSMO_ASSERT(conn->lcs.lb.conn.conn_id != SCCP_CONN_ID_UNSET);

-       osmo_sccp_tx_disconn(bsc_gsmnet->smlc->sccp_user, 
conn->lcs.lb.conn.conn_id, &bsc_gsmnet->smlc->bsc_addr, 0);
+       osmo_sccp_tx_disconn(bsc_gsmnet->smlc->sccp_user,
+                            conn->lcs.lb.conn.conn_id,
+                            &bsc_gsmnet->smlc->bsc_addr,
+                            OSMO_SCCP_REL_REASON_NSU_DISC_NORMAL);

        conn->lcs.lb.state = SUBSCR_SCCP_ST_NONE;
        bsc_sccp = osmo_sccp_get_priv(bsc_gsmnet->smlc->sccp);
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 1fe7739..c96aebf 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -234,7 +234,10 @@

        return 0;
 refuse:
-       osmo_sccp_tx_disconn(scu, scu_prim->u.connect.conn_id, 
&scu_prim->u.connect.called_addr, 0);
+       osmo_sccp_tx_disconn(scu,
+                            scu_prim->u.connect.conn_id,
+                            &scu_prim->u.connect.called_addr,
+                            OSMO_SCCP_REL_REASON_NSU_CREF_END_USER_ORIGIN);
        return rc;
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/43799?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I17bceb7dbd6d8198a07c232eee8aebb7b89a3bf2
Gerrit-Change-Number: 43799
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to