Change in osmo-bts[master]: oml: use regular TLVP_PRES() in rx_oml_ipa_rsl_connect()

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Sun Feb 7 03:49:39 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/22764 )

Change subject: oml: use regular TLVP_PRES() in rx_oml_ipa_rsl_connect()
......................................................................

oml: use regular TLVP_PRES() in rx_oml_ipa_rsl_connect()

Both NM_ATT_IPACC_DST_IP and NM_ATT_IPACC_DST_IP_PORT are defined
as TLV_TYPE_FIXED, and NM_ATT_IPACC_STREAM_ID is TLV_TYPE_TV, so
the TLV parser already does check the length for us.

Change-Id: I1e493e552bb22bb42bb196ce71214e28d23fd19e
---
M src/common/oml.c
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/common/oml.c b/src/common/oml.c
index b1ae7b4..9886fe4 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1390,14 +1390,14 @@
 
 	uint8_t stream_id = 0;
 
-	if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_DST_IP, 4))
+	if (TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP))
 		in.s_addr = tlvp_val32_unal(tp, NM_ATT_IPACC_DST_IP);
 	else
 		in.s_addr = htonl(get_signlink_remote_ip(oml_link));
 
-	if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_DST_IP_PORT, 2))
+	if (TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP_PORT))
 		port = ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_DST_IP_PORT));
-	if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_STREAM_ID, 1))
+	if (TLVP_PRESENT(tp, NM_ATT_IPACC_STREAM_ID))
 		stream_id = *TLVP_VAL(tp, NM_ATT_IPACC_STREAM_ID);
 
 	LOGP(DOML, LOGL_INFO, "%s: Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n",

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/22764
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1e493e552bb22bb42bb196ce71214e28d23fd19e
Gerrit-Change-Number: 22764
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210207/1b3f3a49/attachment.htm>


More information about the gerrit-log mailing list