 
            pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/38581?usp=email )
Change subject: Fix SCCP RLSD not sent upon rx RUA Disconnect due to error condition ......................................................................
Fix SCCP RLSD not sent upon rx RUA Disconnect due to error condition
Scenario: HNB tears down the RUA/Iu conn by first sending RUA_DATA[RANAP IuReleaseReq], followed shortly by a RUA Disconnect with no RANAP and Cause!=Normal. HNBGW should release the SCCP connection through RLSD since it's impossible to terminate the Iu connection in a normal condition.
Validated with TTCN-3 HNBGW_Tests.TC_cs_iu_release_req_rua_disconnect.
Related: osmo-ttcn3-hacks.git Change-Id I6782920c4a86d3311eb54239ab13a18e393c1ec0 Related: SYS#6602 Change-Id: I1b7f72034eaf40bfa60d552d434847467ac4e97a --- M src/osmo-hnbgw/context_map_sccp.c 1 file changed, 15 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/81/38581/1
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c index 511577c..881d5ce 100644 --- a/src/osmo-hnbgw/context_map_sccp.c +++ b/src/osmo-hnbgw/context_map_sccp.c @@ -364,11 +364,21 @@ return;
case MAP_SCCP_EV_RAN_DISC: - /* RUA has disconnected, and usually has sent an Iu-ReleaseComplete along with its RUA Disconnect. On - * SCCP, the Iu-ReleaseComplete should still be forwarded as N-Data (SCCP Data Form 1), and we will - * expect the CN to send an SCCP RLSD soon. */ - map_sccp_fsm_state_chg(MAP_SCCP_ST_WAIT_RLSD); - tx_sccp_df1(fi, ranap_msg); + /* 3GPP TS 25.468 9.1.5: RUA has disconnected. + * - Under normal conditions (cause=Normal) the RUA Disconnect contains a RANAP Iu-ReleaseComplete. + * On SCCP, the Iu-ReleaseComplete should still be forwarded as N-Data SCCP Data Form 1), + * and we will expect the CN to send an SCCP RLSD soon. + * - Under error conditions, cause!=Normal and the's no RANAP message. + * In that case, we need to tear down the associated SCCP link towards CN, + * which in turn will tear down the upper layer Iu conn. + */ + if (msg_has_l2_data(ranap_msg)) { + map_sccp_fsm_state_chg(MAP_SCCP_ST_WAIT_RLSD); + tx_sccp_df1(fi, ranap_msg); + } else { + tx_sccp_rlsd(fi); + map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED); + } return;
case MAP_SCCP_EV_RAN_LINK_LOST:
