summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-30 22:33:17 +0100
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-31 07:54:59 +0100
commit4fb81107bfad2fe4cbea00cb87e1b6fbb92bd869 (patch)
treefbe9e6a85b9165334744647a3d7fd17b2459cbee /src/ipcpd/ipcp.c
parent05fa4879dd8c70156fd98eabed4634098b0feecb (diff)
downloadouroboros-4fb81107bfad2fe4cbea00cb87e1b6fbb92bd869.tar.gz
ouroboros-4fb81107bfad2fe4cbea00cb87e1b6fbb92bd869.zip
ipcpd: Clean shutdown when bootstrap fails
Fixes a double free (conf->dif_name) and the handling of non-created threads when the bootstrap of an IPCP fails
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r--src/ipcpd/ipcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 694db7cf..b7eff3fb 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -234,7 +234,8 @@ void * ipcp_main_loop(void * o)
int fd = -1;
pthread_rwlock_rdlock(&ipcpi.state_lock);
- if (ipcp_get_state() == IPCP_SHUTDOWN) {
+ if (ipcp_get_state() == IPCP_SHUTDOWN
+ || ipcp_get_state() == IPCP_NULL) {
pthread_rwlock_unlock(&ipcpi.state_lock);
break;
}
@@ -281,7 +282,8 @@ void * ipcp_main_loop(void * o)
if (conf_msg->ipcp_type == IPCP_NORMAL) {
conf.addr_size = conf_msg->addr_size;
conf.cep_id_size = conf_msg->cep_id_size;
- conf.pdu_length_size = conf_msg->pdu_length_size;
+ conf.pdu_length_size =
+ conf_msg->pdu_length_size;
conf.qos_id_size = conf_msg->qos_id_size;
conf.seqno_size = conf_msg->seqno_size;
conf.has_ttl = conf_msg->has_ttl;