From 406cf2d7a347222ef0526d1db0d3cb191c287656 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 22 Feb 2017 23:53:04 +0100 Subject: irmd: Check IPCP type before bootstrap This prevents assertion failures in the IPCP in some cases. IPCPs can now safely assert the type. --- src/irmd/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/irmd') 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); -- cgit v1.2.3