path: root/openbsc/src/libmgcp/mgcpgw_client.c
diff options
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-08 15:36:14 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-18 17:50:09 +0200
commit9b5dee4e33fc432898ecfe490e28e0748dea83c9 (patch)
tree098cd84bbf8f852771da551a32acdd35cb142095 /openbsc/src/libmgcp/mgcpgw_client.c
parent21521acd3f9147db01fde7729181c26769efdc77 (diff)
mgcp: make sure all endpoints are closed on startup
If the MSC is crashing and restarting, it may leave some endpoints open. The endpoints can not be re-used until they are deleted (DLCX). This patch sends a DLCX to all possible endpoints (usually this is in a countable range) in order to clear possible open endpoints from a previous run
Diffstat (limited to 'openbsc/src/libmgcp/mgcpgw_client.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/libmgcp/mgcpgw_client.c b/openbsc/src/libmgcp/mgcpgw_client.c
index 0c5b5caf7..4ccff844b 100644
--- a/openbsc/src/libmgcp/mgcpgw_client.c
+++ b/openbsc/src/libmgcp/mgcpgw_client.c
@@ -402,7 +402,8 @@ int mgcpgw_client_connect(struct mgcpgw_client *mgcp)
mgcp->remote_addr = htonl(addr.sin_addr.s_addr);
- osmo_wqueue_init(wq, 10);
+ osmo_wqueue_init(wq, (mgcp->actual.last_endpoint - mgcp->actual.first_endpoint) + 10);
wq->bfd.when = BSC_FD_READ;
wq->bfd.data = mgcp;
wq->read_cb = mgcp_do_read;