diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-12-08 23:58:31 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-12-13 14:54:02 +0000 |
commit | 37f9252361c85249b59d5a9202147136782b5415 (patch) | |
tree | 231819f71697201e3bba98bf5e82bc81cc7a50eb /openbsc/src/libcommon/oap_client.c | |
parent | 2fa74faf927ed1ca9fc311a206c1e18a7295be7a (diff) |
oap_client: make use of OAP optional: disable for NULL config
When passing a NULL config to osmo_oap_client_init(), set OAP to disabled
state. Along with the previous fix that ensures message rejection in the
disabled state, this makes use of OAP in the GSUP client optional.
oap_client_test: expect null config to set state to disabled.
Related: OS#1592
Change-Id: Ie4d622fcfd24cb7d89d19f93e4b2571d8fadd1a3
Diffstat (limited to 'openbsc/src/libcommon/oap_client.c')
-rw-r--r-- | openbsc/src/libcommon/oap_client.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |