summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipcpd/normal/main.c6
-rw-r--r--src/irmd/main.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index e3955ff2..c41b6187 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -344,10 +344,8 @@ static int normal_ipcp_bootstrap(struct dif_config * conf)
(void) pol;
- if (conf == NULL || conf->type != THIS_TYPE) {
- log_err("Bad DIF configuration.");
- return -EINVAL;
- }
+ assert(conf);
+ assert(conf->type == THIS_TYPE);
pthread_rwlock_wrlock(&ipcpi.state_lock);
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 7f20faf4..d49193d3 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -397,6 +397,13 @@ static int bootstrap_ipcp(pid_t api,
return -1;
}
+ if (entry->type != (enum ipcp_type) conf->ipcp_type) {
+ pthread_rwlock_unlock(&irmd->reg_lock);
+ pthread_rwlock_unlock(&irmd->state_lock);
+ log_err("Configuration does not match IPCP type.");
+ return -1;
+ }
+
if (ipcp_bootstrap(entry->api, conf)) {
pthread_rwlock_unlock(&irmd->reg_lock);
pthread_rwlock_unlock(&irmd->state_lock);