diff options
Diffstat (limited to 'src/irmd')
-rw-r--r-- | src/irmd/main.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 73533ef0..262b737c 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -50,7 +50,7 @@ static void destroy_ipcp(rina_name_t * name) } static void bootstrap_ipcp(rina_name_t * name, - struct dif_info * info) + struct dif_config * conf) { LOG_MISSING; } @@ -78,18 +78,12 @@ static void unreg_ipcp(rina_name_t * name, int main() { int sockfd; - uint8_t * buf; + uint8_t buf[IRM_MSG_BUF_SIZE]; sockfd = server_socket_open(IRM_SOCK_PATH); if (sockfd < 0) return -1; - buf = malloc(sizeof(*buf) * IRM_MSG_BUF_SIZE); - if (buf == NULL) { - LOG_ERR("Cannot allocate memory"); - return -ENOMEM; - } - while (true) { int cli_sockfd; struct irm_msg * msg; @@ -120,7 +114,7 @@ int main() break; case IRM_BOOTSTRAP_IPCP: bootstrap_ipcp(msg->name, - msg->info); + msg->conf); break; case IRM_ENROLL_IPCP: enroll_ipcp(msg->name, @@ -140,12 +134,11 @@ int main() LOG_ERR("Don't know that message code"); break; } + free(msg); } close(cli_sockfd); } - free(buf); - return 0; } |