Change in osmo-bts[master]: OML: Return attributes in ACK/NACK messages

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Feb 10 20:05:54 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12863 )

Change subject: OML: Return attributes in ACK/NACK messages
......................................................................

OML: Return attributes in ACK/NACK messages

As per 3GPP TS 12.21 Section 8.2 "ACK messages shall return all the
attributes in the original message". OsmoBTS fails to do so but simply
sends no attributes at all in the ACK.

TS 12.21 is a bit vague whether or not the attributes shall also be
achoed in the NACK.  Let's do it and append the CAUSE in this case.

Closes: OS#3788
Change-Id: Ifb305fe75f8305bb04872f26492b8b1bb8c27f49
---
M src/common/oml.c
1 file changed, 8 insertions(+), 11 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/src/common/oml.c b/src/common/oml.c
index ce59865..6952d75 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -425,26 +425,19 @@
  * contained in 'msg'. ACK is sent if cause == 0; NACK otherwise */
 int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause)
 {
-	struct abis_om_hdr *old_oh = msgb_l2(old_msg);
-	struct abis_om_fom_hdr *old_foh = msgb_l3(old_msg);
 	struct msgb *msg;
 	struct abis_om_fom_hdr *foh;
-	int is_manuf = 0;
 
-	msg = oml_msgb_alloc();
+	msg = msgb_copy(old_msg, "OML_fom_ack_nack");
 	if (!msg)
 		return -ENOMEM;
 
-	/* make sure to respond with MANUF if request was MANUF */
-	if (old_oh->mdisc == ABIS_OM_MDISC_MANUF)
-		is_manuf = 1;
+	/* remove any l2/l1 that may be present in copy */
+	msgb_pull_to_l2(msg);
 
 	msg->trx = old_msg->trx;
 
-	/* copy over old FOM-Header and later only change the msg_type */
-	msg->l3h = msgb_push(msg, sizeof(*foh));
 	foh = (struct abis_om_fom_hdr *) msg->l3h;
-	memcpy(foh, old_foh, sizeof(*foh));
 
 	/* alter message type */
 	if (cause) {
@@ -453,12 +446,16 @@
 		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 {
 		LOGP(DOML, LOGL_DEBUG, "Sending FOM ACK.\n");
 		foh->msg_type++; /* ack */
 	}
 
-	return oml_send_msg(msg, is_manuf);
+	/* we cannot use oml_send_msg() as we already have the OML header */
+	return abis_oml_sendmsg(msg);
 }
 
 /*

-- 
To view, visit https://gerrit.osmocom.org/12863
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb305fe75f8305bb04872f26492b8b1bb8c27f49
Gerrit-Change-Number: 12863
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190210/d843f670/attachment.htm>


More information about the gerrit-log mailing list