From 1a13d42a0792a4a12a40c813072355502e87c42f Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 18 Jun 2021 17:37:11 +0200 Subject: ipcpd: Move RIB initialization to common ground This moves Resource Information Base (RIB) initialization into the ipcp_init() function, so all IPCPs initialize a RIB. The RIB not shows some common IPCP information, such as the IPCP name, IPCP state and the layer name if the IPCP is part of a layer. The initialization of the hash algorithm and layer name was moved out of the common ipcp source because IPCPs may only know this information after enrollment. Some IPCPs were not even storing this information. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/main.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/ipcpd/unicast/main.c') diff --git a/src/ipcpd/unicast/main.c b/src/ipcpd/unicast/main.c index 96df1664..018dd1c6 100644 --- a/src/ipcpd/unicast/main.c +++ b/src/ipcpd/unicast/main.c @@ -313,17 +313,11 @@ static struct ipcp_ops unicast_ops = { int main(int argc, char * argv[]) { - if (ipcp_init(argc, argv, &unicast_ops) < 0) { + if (ipcp_init(argc, argv, &unicast_ops, THIS_TYPE) < 0) { log_err("Failed to init IPCP."); goto fail_init; } - /* These components must be init at creation. */ - if (rib_init(ipcpi.name)) { - log_err("Failed to initialize RIB."); - goto fail_rib_init; - } - if (notifier_init()) { log_err("Failed to initialize notifier component."); goto fail_notifier_init; @@ -364,8 +358,6 @@ int main(int argc, notifier_fini(); - rib_fini(); - ipcp_fini(); exit(EXIT_SUCCESS); @@ -379,8 +371,6 @@ int main(int argc, fail_connmgr_init: notifier_fini(); fail_notifier_init: - rib_fini(); - fail_rib_init: ipcp_fini(); fail_init: ipcp_create_r(-1); -- cgit v1.2.3