From 64f2b95f622a3c2b16e4dbdc8553d506ef870a8c Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 21 Feb 2017 14:45:04 +0100 Subject: ipcpd: normal: Change address authority policy This changes the address authority to follow a similar approach to that of the other policies. No function pointers are passed to its user anymore. --- src/ipcpd/normal/main.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/ipcpd/normal/main.c') diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 74a74c5b..9ce2383d 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -54,7 +54,6 @@ struct { pthread_t acceptor; - struct addr_auth * auth; } normal; void ipcp_sig_handler(int sig, @@ -167,16 +166,15 @@ static int boot_components(void) return -1; } - normal.auth = addr_auth_create(pa); - if (normal.auth == NULL) { + if (addr_auth_init(pa)) { log_err("Failed to init address authority."); return -1; } - ipcpi.address = normal.auth->address(); + ipcpi.address = addr_auth_address(); if (ipcpi.address == 0) { log_err("Failed to get a valid address."); - addr_auth_destroy(normal.auth); + addr_auth_fini(); return -1; } @@ -186,14 +184,14 @@ static int boot_components(void) if (ribmgr_init()) { log_err("Failed to initialize RIB manager."); - addr_auth_destroy(normal.auth); + addr_auth_fini(); return -1; } if (dir_init()) { log_err("Failed to initialize directory."); ribmgr_fini(); - addr_auth_destroy(normal.auth); + addr_auth_fini(); return -1; } @@ -202,7 +200,7 @@ static int boot_components(void) if (fmgr_init()) { dir_fini(); ribmgr_fini(); - addr_auth_destroy(normal.auth); + addr_auth_fini(); log_err("Failed to start flow manager."); return -1; } @@ -211,7 +209,7 @@ static int boot_components(void) fmgr_fini(); dir_fini(); ribmgr_fini(); - addr_auth_destroy(normal.auth); + addr_auth_fini(); log_err("Failed to initialize FRCT."); return -1; } @@ -223,7 +221,7 @@ static int boot_components(void) fmgr_fini(); dir_fini(); ribmgr_fini(); - addr_auth_destroy(normal.auth); + addr_auth_fini(); log_err("Failed to create acceptor thread."); return -1; } @@ -244,7 +242,7 @@ void shutdown_components(void) ribmgr_fini(); - addr_auth_destroy(normal.auth); + addr_auth_fini(); } static int normal_ipcp_enroll(char * dst_name) -- cgit v1.2.3