fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/24837 )


Change subject: rsl: use tlvp_val16be() in rsl_rx_ipac_XXcx()
......................................................................

rsl: use tlvp_val16be() in rsl_rx_ipac_XXcx()

Instead of using tlvp_val16_unal() and then doing ntohs() here
and there, convert the remote port to the host byte order once.

Change-Id: Id883a976a03fd3022ed9d66f703b01244df2d9db
---
M src/common/rsl.c
1 file changed, 4 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/24837/1

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 010b9d3..29388a1 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2615,9 +2615,8 @@
        }

        if (TLVP_PRES_LEN(&tp, RSL_IE_IPAC_REMOTE_PORT, 2)) {
-               connect_port = tlvp_val16_unal(&tp, RSL_IE_IPAC_REMOTE_PORT);
-               LOGPC(DRSL, LOGL_DEBUG, "connect_port=%u ",
-                     ntohs(connect_port));
+               connect_port = tlvp_val16be(&tp, RSL_IE_IPAC_REMOTE_PORT);
+               LOGPC(DRSL, LOGL_DEBUG, "connect_port=%u ", connect_port);
        }

        speech_mode = TLVP_VAL(&tp, RSL_IE_IPAC_SPEECH_MODE);
@@ -2733,7 +2732,7 @@
        } else
                ia.s_addr = connect_ip;
        rc = osmo_rtp_socket_connect(lchan->abis_ip.rtp_socket,
-                                    inet_ntoa(ia), ntohs(connect_port));
+                                    inet_ntoa(ia), connect_port);
        if (rc < 0) {
                LOGPLCHAN(lchan, DRTP, LOGL_ERROR, "Failed to connect RTP/RTCP 
sockets\n");
                osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
@@ -2744,7 +2743,7 @@
        }
        /* save IP address and port number */
        lchan->abis_ip.connect_ip = ntohl(ia.s_addr);
-       lchan->abis_ip.connect_port = ntohs(connect_port);
+       lchan->abis_ip.connect_port = connect_port;

        rc = osmo_rtp_get_bound_ip_port(lchan->abis_ip.rtp_socket,
                                        &lchan->abis_ip.bound_ip,

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id883a976a03fd3022ed9d66f703b01244df2d9db
Gerrit-Change-Number: 24837
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to