aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_protocol.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-05 03:37:22 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-05 06:10:58 +0800
commitc49212778f84736f1cc59fccf7946595c629ed91 (patch)
tree8345d1c5ce33c0b94a7c0f825f5524df0ed3e064 /openbsc/src/mgcp/mgcp_protocol.c
parentbb89aa1430872598cec1f2508cefd040efaefc87 (diff)
mgcp: Move the bfd for rtp/rtcp into the port
Stop using the memset in the mgcp_rtp_end_reset as we will reset the list pointers and then have a mess..
Diffstat (limited to 'openbsc/src/mgcp/mgcp_protocol.c')
-rw-r--r--openbsc/src/mgcp/mgcp_protocol.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 8b990221..69362e4b 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -715,10 +715,19 @@ struct mgcp_config *mgcp_config_alloc(void)
static void mgcp_rtp_end_reset(struct mgcp_rtp_end *end)
{
- memset(end, 0, sizeof(*end));
+ end->packets = 0;
+ memset(&end->addr, 0, sizeof(end->addr));
+ end->rtp_port = end->rtcp_port = end->local_port;
end->payload_type = -1;
}
+static void mgcp_rtp_end_init(struct mgcp_rtp_end *end)
+{
+ mgcp_rtp_end_reset(end);
+ end->rtp.fd = -1;
+ end->rtcp.fd = -1;
+}
+
int mgcp_endpoints_allocate(struct mgcp_config *cfg)
{
int i;
@@ -731,12 +740,10 @@ int mgcp_endpoints_allocate(struct mgcp_config *cfg)
return -1;
for (i = 0; i < cfg->number_endpoints; ++i) {
- cfg->endpoints[i].local_rtp.fd = -1;
- cfg->endpoints[i].local_rtcp.fd = -1;
cfg->endpoints[i].ci = CI_UNUSED;
cfg->endpoints[i].cfg = cfg;
- mgcp_rtp_end_reset(&cfg->endpoints[i].net_end);
- mgcp_rtp_end_reset(&cfg->endpoints[i].bts_end);
+ mgcp_rtp_end_init(&cfg->endpoints[i].net_end);
+ mgcp_rtp_end_init(&cfg->endpoints[i].bts_end);
}
return 0;