From 8e0165c2ee9659ee57934947369659c093db621e Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 30 Nov 2016 15:34:04 +0100 Subject: ipcpd: Split IPCP state PENDING_ENROL This will split the IPCP state PENDING_ENROL into IPCP_CONFIG and IPCP_BOOTING. IPCP_CONFIG is concerned only with configuring the IPCP with the bare essence. When in IPCP_BOOTING, the IPCP will complete its configuration by starting its policies, and thus making the IPCP completely functioning. --- src/ipcpd/shim-udp/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ipcpd/shim-udp') diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c index eff0bd94..67161d90 100644 --- a/src/ipcpd/shim-udp/main.c +++ b/src/ipcpd/shim-udp/main.c @@ -486,7 +486,7 @@ static void * ipcp_udp_sdu_loop(void * o) while (flow_event_wait(udp_data.np1_flows, udp_data.fq, &timeout)) { pthread_rwlock_rdlock(&ipcpi.state_lock); - if (ipcp_get_state() != IPCP_ENROLLED) { + if (ipcp_get_state() != IPCP_RUNNING) { pthread_rwlock_unlock(&ipcpi.state_lock); return (void *) -1; /* -ENOTENROLLED */ } @@ -531,7 +531,7 @@ void ipcp_sig_handler(int sig, siginfo_t * info, void * c) if (ipcp_get_state() == IPCP_INIT) ipcp_set_state(IPCP_NULL); - if (ipcp_get_state() == IPCP_ENROLLED) + if (ipcp_get_state() == IPCP_RUNNING) ipcp_set_state(IPCP_SHUTDOWN); pthread_rwlock_unlock(&ipcpi.state_lock); @@ -616,7 +616,7 @@ static int ipcp_udp_bootstrap(struct dif_config * conf) FD_CLR(udp_data.s_fd, &udp_data.flow_fd_s); - ipcp_set_state(IPCP_ENROLLED); + ipcp_set_state(IPCP_RUNNING); pthread_create(&udp_data.handler, NULL, @@ -890,7 +890,7 @@ static int ipcp_udp_name_query(char * name) pthread_rwlock_rdlock(&ipcpi.state_lock); - if (ipcp_get_state() != IPCP_ENROLLED) { + if (ipcp_get_state() != IPCP_RUNNING) { pthread_rwlock_unlock(&ipcpi.state_lock); LOG_DBG("Won't query a name on a non-enrolled IPCP."); return -1; /* -ENOTENROLLED */ @@ -915,7 +915,7 @@ static int ipcp_udp_name_query(char * name) pthread_rwlock_rdlock(&ipcpi.state_lock); - if (ipcp_get_state() != IPCP_ENROLLED) { + if (ipcp_get_state() != IPCP_RUNNING) { pthread_rwlock_unlock(&ipcpi.state_lock); LOG_DBG("Won't add name to the directory."); return -1; /* -ENOTENROLLED */ @@ -991,7 +991,7 @@ static int ipcp_udp_flow_alloc(int fd, pthread_rwlock_rdlock(&ipcpi.state_lock); - if (ipcp_get_state() != IPCP_ENROLLED) { + if (ipcp_get_state() != IPCP_RUNNING) { pthread_rwlock_unlock(&ipcpi.state_lock); LOG_DBG("Won't allocate flow with non-enrolled IPCP."); close(skfd); @@ -1113,7 +1113,7 @@ static int ipcp_udp_flow_dealloc(int fd) pthread_rwlock_rdlock(&ipcpi.state_lock); - if (ipcp_get_state() != IPCP_ENROLLED) { + if (ipcp_get_state() != IPCP_RUNNING) { pthread_rwlock_unlock(&ipcpi.state_lock); LOG_DBG("Won't register with non-enrolled IPCP."); return -1; /* -ENOTENROLLED */ -- cgit v1.2.3