osmith submitted this change.

View Change


Approvals: pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
hnbgw_mgw_setup: use mgcp_client_pool_empty()

Don't fall back to the legacy config if the pool is configured but no
connection to any pool member can be established.

Depends: osmo-mgw I009483ac9dfd6627e414f14d43b89f40ea4644db
Related: OS#5993
Change-Id: Icf3f3f0524c9d27f645c68851aaf9c6f33842927
---
M TODO-RELEASE
M src/osmo-hnbgw/hnbgw.c
2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/TODO-RELEASE b/TODO-RELEASE
index cec63db..cf72895 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -10,3 +10,4 @@
osmo-hnbgw cfg config deprecated: 'sccp cr max-payload-len <0-999999>'
libosmo-sigtran >=1.7.0 Ensure SCCP CR max payload length of 130 bytes is enforced.
Uses osmo_scu_prim_hdr_name_c()
+libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty()
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 0624803..bd45dda 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -693,8 +693,12 @@
/* Initialize MGW pool. This initalizes and connects all MGCP clients that are currently configured in
* the pool. Adding additional MGCP clients to the pool is possible but the user has to configure and
* (re)connect them manually from the VTY. */
- pool_members_initalized = mgcp_client_pool_connect(g_hnb_gw->mgw_pool);
- if (pool_members_initalized) {
+ if (!mgcp_client_pool_empty(g_hnb_gw->mgw_pool)) {
+ pool_members_initalized = mgcp_client_pool_connect(g_hnb_gw->mgw_pool);
+ if (!pool_members_initalized) {
+ LOGP(DMGW, LOGL_ERROR, "MGW pool failed to initialize any pool members\n");
+ return -EINVAL;
+ }
LOGP(DMGW, LOGL_NOTICE,
"MGW pool with %u pool members configured, (ignoring MGW configuration in VTY node 'mgcp').\n",
pool_members_initalized);

To view, visit change 32208. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Icf3f3f0524c9d27f645c68851aaf9c6f33842927
Gerrit-Change-Number: 32208
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged