dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10408


Change subject: mgcp_client: check local port only once
......................................................................

mgcp_client: check local port only once

When the user has set a local port for the mgcp client we want the
client to exit if this port is already occupied. If no port is set the
IETF default port is configured automatically. When we find this port
occupied we try up to 100 times the next port to find a useable port.

Since the for loop that controls the attempts always sets the port
config it uses for its checks it will mistakenly assume that the user
has set a port on the second cycle.

- Make sure we only check for the default port in the first cycle

Change-Id: Ic1fd1018d68fcac94961321615bfdd726465532d
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/10408/1

diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 3663163..c10abc9 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -801,7 +801,7 @@
                 * configured then we assume that the user has choosen
                 * that port conciously and we will not try to resolve
                 * this by silently choosing a different port. */
-               if (mgcp->actual.local_port != MGCP_CLIENT_LOCAL_PORT_DEFAULT)
+               if (mgcp->actual.local_port != MGCP_CLIENT_LOCAL_PORT_DEFAULT 
&& i == 0)
                        return -EINVAL;

                /* Choose a new port number to try next */

--
To view, visit https://gerrit.osmocom.org/10408
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1fd1018d68fcac94961321615bfdd726465532d
Gerrit-Change-Number: 10408
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pma...@sysmocom.de>

Reply via email to