diff options
author | Keith <keith@rhizomatica.org> | 2019-08-06 14:06:54 +0200 |
---|---|---|
committer | Keith <keith@rhizomatica.org> | 2019-08-06 14:38:32 +0200 |
commit | 1f1f3f6fb996205db2413effe4be781b130b87e2 (patch) | |
tree | e0ffb4d36bcfdd94380ca42f7713e622864bef0d | |
parent | d0a8fa90627285a1cc5b31eb5f623c4f8e88c1c4 (diff) |
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
-rw-r--r-- | src/mncc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -181,7 +181,7 @@ static bool send_rtp_connect(struct mncc_call_leg *leg, struct call_leg *other) */ 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 @@ static void check_rtp_create(struct mncc_connection *conn, const char *buf, int } /* 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, |