diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-02-21 14:45:04 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2017-02-21 14:45:04 +0100 |
commit | 64f2b95f622a3c2b16e4dbdc8553d506ef870a8c (patch) | |
tree | ffe86d4470e121c47fa11faf8dd5f921f1b6de1f /src/ipcpd/normal/main.c | |
parent | 91091367210ee204c4082a0da05eea3336674f19 (diff) | |
download | ouroboros-64f2b95f622a3c2b16e4dbdc8553d506ef870a8c.tar.gz ouroboros-64f2b95f622a3c2b16e4dbdc8553d506ef870a8c.zip |
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.
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r-- | src/ipcpd/normal/main.c | 20 |
1 files changed, 9 insertions, 11 deletions
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) |