diff options
author | Sander Vrijders <[email protected]> | 2016-11-30 15:34:04 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-11-30 15:34:04 +0100 |
commit | 8e0165c2ee9659ee57934947369659c093db621e (patch) | |
tree | 43d5bb68ac2c369f6e3122f33243bf013d3e3e5d /src/ipcpd/shim-udp/main.c | |
parent | fb4cf92a8f2d2e074d302f4b94385e5e95d6a7d4 (diff) | |
download | ouroboros-8e0165c2ee9659ee57934947369659c093db621e.tar.gz ouroboros-8e0165c2ee9659ee57934947369659c093db621e.zip |
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.
Diffstat (limited to 'src/ipcpd/shim-udp/main.c')
-rw-r--r-- | src/ipcpd/shim-udp/main.c | 14 |
1 files changed, 7 insertions, 7 deletions
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 */ |