Change in osmo-bts[master]: oml: avoid redundant ntohl() / htonl() conversion

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:39:54 UTC 2021


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

Change subject: oml: avoid redundant ntohl() / htonl() conversion
......................................................................

oml: avoid redundant ntohl() / htonl() conversion

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

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/common/oml.c b/src/common/oml.c
index ce76064..b7b86e3 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1384,7 +1384,6 @@
 {
 	struct e1inp_sign_link *oml_link = trx->bts->oml_link;
 	uint16_t port = IPA_TCP_PORT_RSL;
-	uint32_t ip = get_signlink_remote_ip(oml_link);
 	const char *trx_name = gsm_trx_name(trx);
 	struct in_addr in;
 	int rc;
@@ -1392,13 +1391,15 @@
 	uint8_t stream_id = 0;
 
 	if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_DST_IP, 4))
-		ip = ntohl(tlvp_val32_unal(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))
 		port = ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_DST_IP_PORT));
 	if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_STREAM_ID, 1))
 		stream_id = *TLVP_VAL(tp, NM_ATT_IPACC_STREAM_ID);
 
-	in.s_addr = htonl(ip);
 	LOGP(DOML, LOGL_INFO, "%s: Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n",
 	     trx_name, inet_ntoa(in), port, stream_id);
 

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I2ae84dcd2987ff0cee5ca06ced06e65a30847a81
Gerrit-Change-Number: 22761
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-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210207/0c138fd5/attachment.htm>


More information about the gerrit-log mailing list