From 12f880ce6e6dccb9ec76a2b960413e625ad03aef Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 11 Aug 2016 15:20:46 +0200 Subject: ipcpd: normal: Fix log message --- src/ipcpd/normal/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 1599166d..555eb63d 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -176,7 +176,7 @@ static int normal_ipcp_bootstrap(struct dif_config * conf) } if (api_bind(conf->dif_name) < 0) { - printf("Failed to bind the server api."); + LOG_ERR("Failed to bind the server api."); return -1; } -- cgit v1.2.3 From b3c27cda358c24e867a42199e0d5702d9d0b1607 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 11 Aug 2016 16:32:50 +0200 Subject: ipcpd: Fix deep copy of dif_config conf->dif_name was not copied from the dif_config gpb message. Fixes some logs. --- src/ipcpd/ipcp.c | 4 ++-- src/ipcpd/normal/main.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index 784d845a..24f580e5 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -173,6 +173,7 @@ void * ipcp_main_loop(void * o) } conf_msg = msg->conf; conf.type = conf_msg->ipcp_type; + conf.dif_name = conf_msg->dif_name; if (conf_msg->ipcp_type == IPCP_NORMAL) { conf.addr_size = conf_msg->addr_size; conf.cep_id_size = conf_msg->cep_id_size; @@ -202,8 +203,7 @@ void * ipcp_main_loop(void * o) break; } ret_msg.has_result = true; - ret_msg.result = - _ipcp->ops->ipcp_enroll(msg->dif_name); + ret_msg.result = _ipcp->ops->ipcp_enroll(msg->dif_name); break; case IPCP_MSG_CODE__IPCP_NAME_REG: diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 555eb63d..b5aad271 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -135,7 +135,7 @@ static int normal_ipcp_enroll(char * dif_name) if (_ipcp->state != IPCP_INIT) { pthread_rwlock_unlock(&_ipcp->state_lock); - LOG_DBGF("Won't enroll an IPCP that is not in INIT."); + LOG_ERR("Won't enroll an IPCP that is not in INIT."); return -1; /* -ENOTINIT */ } @@ -161,11 +161,13 @@ static int normal_ipcp_enroll(char * dif_name) static int normal_ipcp_bootstrap(struct dif_config * conf) { + LOG_DBGF("bootstrapping in dif %s.", conf->dif_name); + pthread_rwlock_rdlock(&_ipcp->state_lock); if (_ipcp->state != IPCP_INIT) { pthread_rwlock_unlock(&_ipcp->state_lock); - LOG_DBGF("Won't bootstrap an IPCP that is not in INIT."); + LOG_ERR("Won't bootstrap an IPCP that is not in INIT."); return -1; /* -ENOTINIT */ } @@ -176,7 +178,7 @@ static int normal_ipcp_bootstrap(struct dif_config * conf) } if (api_bind(conf->dif_name) < 0) { - LOG_ERR("Failed to bind the server api."); + LOG_ERR("Failed to bind the server AP instance."); return -1; } -- cgit v1.2.3