aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-09 00:32:00 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-22 15:15:06 +0200
commit07ec8eebe0537848e00ee346b8d8ac2bcbe22fab (patch)
tree18fbeed9e62b2f0452ba0c4e836f2640c2e21a8d /openbsc
parent25a2db018eff0a86e9e79ed2aa31489535fea9c1 (diff)
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.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libmgcp/osmux.c9
1 files 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));
}