summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-02-21 14:10:53 +0000
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2017-02-21 14:10:53 +0000
commit198e319d14af53891b81cca36fe92e06d5d7d67d (patch)
treeffe86d4470e121c47fa11faf8dd5f921f1b6de1f /src/ipcpd/normal/main.c
parent91091367210ee204c4082a0da05eea3336674f19 (diff)
parent64f2b95f622a3c2b16e4dbdc8553d506ef870a8c (diff)
downloadouroboros-198e319d14af53891b81cca36fe92e06d5d7d67d.tar.gz
ouroboros-198e319d14af53891b81cca36fe92e06d5d7d67d.zip
Merged in sandervrijders/ouroboros/be-addr (pull request #384)
ipcpd: normal: Change address authority policy
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r--src/ipcpd/normal/main.c20
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)