Change in ...osmo-sip-connector[master]: IPs stored in the call struct are NETWORK byte order

neels gerrit-no-reply at lists.osmocom.org
Tue Aug 6 12:45:51 UTC 2019


neels has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-sip-connector/+/15063 )

Change subject: IPs stored in the call struct are NETWORK byte order
......................................................................

IPs stored in the call struct are NETWORK byte order

As far as I can make out, the intention is to always store ip address in the call struct
in network byte order, whereas the ip address sent on MNCC are in host byte order.

Change-Id: I89ef26aa32a672f394699251cf560b53ae01a814
---
M src/mncc.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/mncc.c b/src/mncc.c
index 81fe30f..7bffbd1 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -181,7 +181,7 @@
 	 */
 	mncc.msg_type = MNCC_RTP_CONNECT;
 	mncc.callref = leg->callref;
-	mncc.ip = htonl(other->ip);
+	mncc.ip = ntohl(other->ip);
 	mncc.port = other->port;
 	mncc.payload_type = other->payload_type;
 	/*
@@ -410,13 +410,13 @@
 	}
 
 	/* extract information about where the RTP is */
-	leg->base.ip = rtp->ip;
+	leg->base.ip = htonl(rtp->ip);
 	leg->base.port = rtp->port;
 	leg->base.payload_type = rtp->payload_type;
 	leg->base.payload_msg_type = rtp->payload_msg_type;
 
 	/* TODO.. now we can continue with the call */
-	struct in_addr net = { .s_addr = htonl(leg->base.ip) };
+	struct in_addr net = { .s_addr = leg->base.ip };
 	LOGP(DMNCC, LOGL_DEBUG,
 		"RTP cnt leg(%u) ip(%s), port(%u) pt(%u) ptm(%u)\n",
 		leg->callref, inet_ntoa(net), leg->base.port,

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I89ef26aa32a672f394699251cf560b53ae01a814
Gerrit-Change-Number: 15063
Gerrit-PatchSet: 2
Gerrit-Owner: keith <keith at rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
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/20190806/82af8d5a/attachment.html>


More information about the gerrit-log mailing list