pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/33467 )
Change subject: mgcp-client: Always mark client as UP if keepalive request-interval disabled ......................................................................
mgcp-client: Always mark client as UP if keepalive request-interval disabled
In the previous logic, if "keepalive request-interval" was disabled (value 0, default), then if the client was configured to send a DLCX on startup it would end up in state UP or DOWN depending on whether the MGW answered to that request. As a result, an MGW that wouldn't answer would be left forever in DOWN state since it would have been selected no more and there would be a keepalive configured to re-mark it as UP.
Change-Id: I290f7436f48418ee25179951359c76208796e279 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 23 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/67/33467/1
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 677a4f3..b0ccfe7 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -951,16 +951,16 @@ some_dlcx_sent = true; }
- if (!some_dlcx_sent) { - if (mgcp->actual.keepalive.req_interval_sec > 0) { + if (mgcp->actual.keepalive.req_interval_sec > 0) { + if (!some_dlcx_sent) { /* Attempt an immediate probe to find out if link is UP or DOWN: */ osmo_timer_schedule(&mgcp->keepalive_tx_timer, 0, 0); - } else { - /* Assume link is UP by default, so that this MGW can be selected: */ - mgcp->conn_up = true; } + /* else: keepalive_tx_timer was already scheduled (if needed) down in the stack during Tx DLCX above */ + } else { + /* Assume link is UP by default, so that this MGW can be selected: */ + mgcp->conn_up = true; } - /* else: keepalive_tx_timer was already scheduled (if needed) down in the stack during Tx DLCX above */
if (mgcp->actual.keepalive.timeout_sec > 0) osmo_timer_schedule(&mgcp->keepalive_rx_timer, mgcp->actual.keepalive.timeout_sec, 0);