From 07ec8eebe0537848e00ee346b8d8ac2bcbe22fab Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 9 Jul 2014 00:32:00 +0200 Subject: osmux: Send the CI as part of the dummy to help to identify a client We need to discover the remote port as we are likely behind a NAT. Right now the NAT code will just send to port 1984 on the BSC but this might not arrive at the BSC. Include the CI (in the future we need to include the endpoint address or send the dummy to the net port). This is just an interim solution. --- openbsc/src/libmgcp/osmux.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openbsc/src/libmgcp/osmux.c b/openbsc/src/libmgcp/osmux.c index 1c59e261b..716b5f57a 100644 --- a/openbsc/src/libmgcp/osmux.c +++ b/openbsc/src/libmgcp/osmux.c @@ -393,11 +393,16 @@ int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role) */ int osmux_send_dummy(struct mgcp_endpoint *endp) { - static char buf[] = { MGCP_DUMMY_LOAD }; + uint32_t ci_be; + char buf[1 + sizeof(uint32_t)]; + + ci_be = htonl(endp->ci); + buf[0] = MGCP_DUMMY_LOAD; + memcpy(&buf[1], &ci_be, sizeof(ci_be)); LOGP(DMGCP, LOGL_DEBUG, "sending OSMUX dummy load to %s\n", inet_ntoa(endp->net_end.addr)); return mgcp_udp_send(osmux_fd.fd, &endp->net_end.addr, - htons(OSMUX_PORT), buf, 1); + htons(OSMUX_PORT), buf, sizeof(buf)); } -- cgit v1.2.3