summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/normal/fmgr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c
index 2800dcb2..3da392c5 100644
--- a/src/ipcpd/normal/fmgr.c
+++ b/src/ipcpd/normal/fmgr.c
@@ -402,6 +402,16 @@ int fmgr_np1_alloc(int fd,
buffer_t buf;
flow_alloc_msg_t msg = FLOW_ALLOC_MSG__INIT;
+ pthread_rwlock_rdlock(&ipcpi.state_lock);
+
+ if (ipcp_get_state() != IPCP_ENROLLED) {
+ pthread_rwlock_unlock(&ipcpi.state_lock);
+ LOG_ERR("IPCP is not enrolled yet.");
+ return -1; /* -ENOTINIT */
+ }
+
+ pthread_rwlock_unlock(&ipcpi.state_lock);
+
/* FIXME: Obtain correct address here from DIF NSM */
msg.code = FLOW_ALLOC_CODE__FLOW_REQ;