aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon/oap_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/libcommon/oap_client.c')
-rw-r--r--openbsc/src/libcommon/oap_client.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/libcommon/oap_client.c b/openbsc/src/libcommon/oap_client.c
index 46dbcdda2..e372edea9 100644
--- a/openbsc/src/libcommon/oap_client.c
+++ b/openbsc/src/libcommon/oap_client.c
@@ -21,6 +21,7 @@
*/
#include <string.h>
+#include <errno.h>
#include <osmocom/core/utils.h>
#include <osmocom/crypt/auth.h>
@@ -224,6 +225,21 @@ int oap_client_handle(struct oap_client_state *state,
return -10;
}
+ switch (state->state) {
+ case OAP_UNINITIALIZED:
+ LOGP(DLOAP, LOGL_ERROR,
+ "Received OAP message %d, but the OAP client is"
+ " not initialized\n", oap_msg.message_type);
+ return -ENOTCONN;
+ case OAP_DISABLED:
+ LOGP(DLOAP, LOGL_ERROR,
+ "Received OAP message %d, but the OAP client is"
+ " disabled\n", oap_msg.message_type);
+ return -ENOTCONN;
+ default:
+ break;
+ }
+
switch (oap_msg.message_type) {
case OAP_MSGT_CHALLENGE_REQUEST:
return handle_challenge(state, &oap_msg, msg_tx);