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/broadcast/main.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/ipcpd/broadcast') diff --git a/src/ipcpd/broadcast/main.c b/src/ipcpd/broadcast/main.c index a2643029..522d1391 100644 --- a/src/ipcpd/broadcast/main.c +++ b/src/ipcpd/broadcast/main.c @@ -274,17 +274,11 @@ static struct ipcp_ops broadcast_ops = { int main(int argc, char * argv[]) { - if (ipcp_init(argc, argv, &broadcast_ops) < 0) { + if (ipcp_init(argc, argv, &broadcast_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; @@ -324,8 +318,6 @@ int main(int argc, notifier_fini(); - rib_fini(); - ipcp_fini(); exit(EXIT_SUCCESS); @@ -339,8 +331,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