pespin submitted this change.

View Change

Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
sbcap: Improve handling of WriteReplaceWarnResponse

If cause != accepted, submit a NACK to the upper layers.
In that case, in the upper layers we don't want to parse the PDU IE
"Unknown Tracking Area List" since it shouldn't be there. 3GPP TS
29.168 4.3.4.3.6 states:
"""
This IE shall only be included if the Cause IE indicates Message accepted, which means the MME will proceed with the
request for Tracking Areas that are known to the MME. The Cause IE indicating Tracking area not valid is used when
all Tracking Areas in the Request are invalid.
"""

Change-Id: I0a4d5bdbb6c4fd3870a4f4ebf226668b70fea06a
---
M src/sbcap_link_fsm.c
1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/sbcap_link_fsm.c b/src/sbcap_link_fsm.c
index 6a50e91..f2cbe82 100644
--- a/src/sbcap_link_fsm.c
+++ b/src/sbcap_link_fsm.c
@@ -241,6 +241,34 @@
return 0;
}

+/* Rx Write Replace Warning Response from peer */
+static int cbc_sbcap_link_rx_write_replace_warn_resp(struct cbc_sbcap_link *link,
+ struct cbc_message_peer *mp,
+ SBcAP_SBC_AP_PDU_t *pdu)
+{
+ A_SEQUENCE_OF(void) *as_pdu;
+ SBcAP_Write_Replace_Warning_Response_IEs_t *ie;
+ SBcAP_SBC_AP_PDU_t *err_ind_pdu;
+ int ev = SMSCB_E_SBCAP_WRITE_ACK;
+
+ as_pdu = (void *)&pdu->choice.successfulOutcome.value.choice.Write_Replace_Warning_Response.protocolIEs.list;
+
+ /* static const long asn_VAL_19_SBcAP_id_Cause = 1; */
+ ie = sbcap_as_find_ie(as_pdu, 1);
+ if (ie) {
+ if (ie->value.choice.Cause != SBcAP_Cause_message_accepted)
+ ev = SMSCB_E_SBCAP_WRITE_NACK;
+ } else { /* This shouldn't happen, the IE is Mandatory... */
+ ev = SMSCB_E_SBCAP_WRITE_NACK;
+ err_ind_pdu = sbcap_gen_error_ind(link,
+ SBcAP_Cause_missing_mandatory_element, pdu);
+ if (err_ind_pdu)
+ cbc_sbcap_link_tx(link, err_ind_pdu);
+ }
+
+ return osmo_fsm_inst_dispatch(mp->fi, ev, pdu);
+}
+
/* message was received from remote SBc-AP peer (MME) */
int cbc_sbcap_link_rx_cb(struct cbc_sbcap_link *link, SBcAP_SBC_AP_PDU_t *pdu)
{
@@ -345,7 +373,7 @@
//if (dec->u.write_replace_compl.old_serial_nr)
// return osmo_fsm_inst_dispatch(mp->fi, SMSCB_E_SBcAP_REPLACE_ACK, dec);
//else
- return osmo_fsm_inst_dispatch(mp->fi, SMSCB_E_SBCAP_WRITE_ACK, pdu);
+ return cbc_sbcap_link_rx_write_replace_warn_resp(link, mp, pdu);
case SBcAP_ProcedureId_Stop_Warning:
return osmo_fsm_inst_dispatch(mp->fi, SMSCB_E_SBCAP_DELETE_ACK, pdu);
default:

To view, visit change 28824. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I0a4d5bdbb6c4fd3870a4f4ebf226668b70fea06a
Gerrit-Change-Number: 28824
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-CC: laforge <laforge@osmocom.org>
Gerrit-MessageType: merged