summaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libcommon')
-rw-r--r--openbsc/src/libcommon/gsup_client.c5
-rw-r--r--openbsc/src/libcommon/oap_client.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/libcommon/gsup_client.c b/openbsc/src/libcommon/gsup_client.c
index 4c1fe6111..2e920a6b6 100644
--- a/openbsc/src/libcommon/gsup_client.c
+++ b/openbsc/src/libcommon/gsup_client.c
@@ -266,7 +266,7 @@ static void start_test_procedure(struct gsup_client *gsupc)
struct gsup_client *gsup_client_create(const char *ip_addr,
unsigned int tcp_port,
gsup_client_read_cb_t read_cb,
- struct oap_client_config *oap_config)
+ struct oap_client_config *oapc_config)
{
struct gsup_client *gsupc;
int rc;
@@ -274,7 +274,8 @@ struct gsup_client *gsup_client_create(const char *ip_addr,
gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client);
OSMO_ASSERT(gsupc);
- rc = oap_client_init(oap_config, &gsupc->oap_state);
+ /* a NULL oapc_config will mark oap_state disabled. */
+ rc = oap_client_init(oapc_config, &gsupc->oap_state);
if (rc != 0)
goto failed;
diff --git a/openbsc/src/libcommon/oap_client.c b/openbsc/src/libcommon/oap_client.c
index e372edea9..54b71e442 100644
--- a/openbsc/src/libcommon/oap_client.c
+++ b/openbsc/src/libcommon/oap_client.c
@@ -35,6 +35,9 @@ int oap_client_init(struct oap_client_config *config,
{
OSMO_ASSERT(state->state == OAP_UNINITIALIZED);
+ if (!config)
+ goto disable;
+
if (config->client_id == 0)
goto disable;