diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2021-02-06 17:03:30 +0100 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-02-10 15:06:54 +0000 |
commit | dabe5d0327854bb4f070a6774b94dd8112867b2c (patch) | |
tree | e4336a03b2e8378a00e6678ebcbd19bc0bcaf6a4 | |
parent | 522a33fe82056a444678d19b0522f0e3fb602d14 (diff) |
oml: ensure that IPA RSL Connect ACK/NACK contains all IEs
All IEs in the BSC originated message are optional, so we assume
default values for them. Let's reflect them all in the ACK/NACK.
Change-Id: I5c73e83daad0cea07b9cb674c393e0bfc6268a61
Related: OS#3791
-rw-r--r-- | src/common/oml.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/common/oml.c b/src/common/oml.c index d395d8f6..c32260bd 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -442,14 +442,15 @@ int oml_fom_ack_nack(struct msgb *msg, uint8_t cause) foh->msg_type += 2; /* nack */ /* add cause */ msgb_tv_put(msg, NM_ATT_NACK_CAUSES, cause); - /* update the length as we just made the message larger */ - struct abis_om_hdr *omh = (struct abis_om_hdr *) msgb_l2(msg); - omh->length = msgb_l3len(msg); } else { LOGPFOH(DOML, LOGL_DEBUG, foh, "Sending FOM ACK.\n"); foh->msg_type++; /* ack */ } + /* ensure that the message length is up to date */ + struct abis_om_hdr *omh = (struct abis_om_hdr *) msgb_l2(msg); + omh->length = msgb_l3len(msg); + /* we cannot use oml_send_msg() as we already have the OML header */ if (abis_oml_sendmsg(msg) != 0) LOGPFOH(DOML, LOGL_ERROR, foh, "Failed to send ACK/NACK\n"); @@ -1406,6 +1407,16 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts_trx *trx, struct msgb *msg, trx->rsl_tei = stream_id; rc = e1inp_ipa_bts_rsl_connect_n(oml_link->ts->line, inet_ntoa(in), port, trx->nr); } + + /* The ACK/NACK is expected to contain all IEs */ + if (!TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP)) /* TV32 */ + msgb_tv_fixed_put(msg, NM_ATT_IPACC_DST_IP, sizeof(in), + (const uint8_t *) &in); + if (!TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP_PORT)) /* TV16 */ + msgb_tv16_put(msg, NM_ATT_IPACC_DST_IP_PORT, port); + if (!TLVP_PRESENT(tp, NM_ATT_IPACC_STREAM_ID)) /* TV */ + msgb_tv_put(msg, NM_ATT_IPACC_STREAM_ID, stream_id); + if (rc < 0) { LOGP(DOML, LOGL_ERROR, "%s: Error in abis_open(RSL): %d\n", trx_name, rc); return oml_fom_ack_nack(msg, NM_NACK_CANT_PERFORM); |