mgcp: Only use early bind for the BTS socket.
Simplify the code by onlt allowing one way to allocate
a socket.
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 9bb315a..8b99022 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -428,11 +428,8 @@
/* bind to the port now */
port = rtp_calculate_port(ENDPOINT_NUMBER(endp), cfg->rtp_base_port);
- if (cfg->early_bind) {
- endp->bts_end.local_port = port;
- endp->net_end.local_port = port;
- } else if (mgcp_bind_rtp_port(endp, port) != 0)
- goto error2;
+ endp->bts_end.local_port = port;
+ endp->net_end.local_port = port;
/* assign a local call identifier or fail */
endp->ci = generate_call_id(cfg);
@@ -760,11 +757,6 @@
endp->local_options = NULL;
}
- if (!endp->cfg->early_bind) {
- bsc_unregister_fd(&endp->local_rtp);
- bsc_unregister_fd(&endp->local_rtcp);
- }
-
mgcp_rtp_end_reset(&endp->bts_end);
mgcp_rtp_end_reset(&endp->net_end);