*: stop double initialization of ferr

* Stop double init of ferr
* Fixup bugs in zebra ferr
* Add missing init in ospfd

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2018-06-20 18:48:35 +00:00
parent 247dcce2b5
commit 5ad4c39ce4
15 changed files with 11 additions and 22 deletions

View File

@ -57,7 +57,5 @@ static struct ferr_ref ferr_babel_err[] = {
void babel_error_init(void) void babel_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_babel_err); ferr_ref_add(ferr_babel_err);
} }

View File

@ -302,7 +302,5 @@ static struct ferr_ref ferr_bgp_err[] = {
void bgp_error_init(void) void bgp_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_bgp_err); ferr_ref_add(ferr_bgp_err);
} }

View File

@ -45,7 +45,5 @@ static struct ferr_ref ferr_eigrp_err[] = {
void eigrp_error_init(void) void eigrp_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_eigrp_err); ferr_ref_add(ferr_eigrp_err);
} }

View File

@ -45,7 +45,5 @@ static struct ferr_ref ferr_isis_err[] = {
void isis_error_init(void) void isis_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_isis_err); ferr_ref_add(ferr_isis_err);
} }

View File

@ -114,6 +114,5 @@ static struct ferr_ref ferr_lib_err[] = {
void lib_error_init(void) void lib_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_lib_err); ferr_ref_add(ferr_lib_err);
} }

View File

@ -599,6 +599,7 @@ struct thread_master *frr_init(void)
vty_init(master); vty_init(master);
memory_init(); memory_init();
ferr_ref_init();
lib_error_init(); lib_error_init();
return master; return master;

View File

@ -45,7 +45,5 @@ static struct ferr_ref ferr_nhrp_err[] = {
void nhrp_error_init(void) void nhrp_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_nhrp_err); ferr_ref_add(ferr_nhrp_err);
} }

View File

@ -80,7 +80,5 @@ static struct ferr_ref ferr_ospf_err[] = {
void ospf_error_init(void) void ospf_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_ospf_err); ferr_ref_add(ferr_ospf_err);
} }

View File

@ -207,6 +207,9 @@ int main(int argc, char **argv)
ospf_route_map_init(); ospf_route_map_init();
ospf_opaque_init(); ospf_opaque_init();
/* OSPF errors init */
ospf_error_init();
/* Need to initialize the default ospf structure, so the interface mode /* Need to initialize the default ospf structure, so the interface mode
commands can be duly processed if they are received before 'router commands can be duly processed if they are received before 'router
ospf', ospf',

View File

@ -45,7 +45,5 @@ static struct ferr_ref ferr_pim_err[] = {
void pim_error_init(void) void pim_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_pim_err); ferr_ref_add(ferr_pim_err);
} }

View File

@ -37,7 +37,5 @@ static struct ferr_ref ferr_rip_err[] = {
void rip_error_init(void) void rip_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_rip_err); ferr_ref_add(ferr_rip_err);
} }

View File

@ -39,7 +39,5 @@ static struct ferr_ref ferr_watchfrr_err[] = {
void watchfrr_error_init(void) void watchfrr_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_watchfrr_err); ferr_ref_add(ferr_watchfrr_err);
} }

View File

@ -413,6 +413,9 @@ int main(int argc, char **argv)
/* RNH init */ /* RNH init */
zebra_rnh_init(); zebra_rnh_init();
/* Error init */
zebra_error_init();
#if defined(HANDLE_ZAPI_FUZZING) #if defined(HANDLE_ZAPI_FUZZING)
if (zapi_fuzzing) { if (zapi_fuzzing) {

View File

@ -265,13 +265,14 @@ static struct ferr_ref ferr_zebra_err[] = {
.description = "Zebra attempted to add a VNI hash to an interface and failed", .description = "Zebra attempted to add a VNI hash to an interface and failed",
.suggestion = "Notify a developer.", .suggestion = "Notify a developer.",
}, },
{
.code = END_FERR,
}
}; };
/* clang-format on */ /* clang-format on */
void zebra_error_init(void) void zebra_error_init(void)
{ {
ferr_ref_init();
ferr_ref_add(ferr_zebra_err); ferr_ref_add(ferr_zebra_err);
} }

View File

@ -24,7 +24,7 @@
#include "lib/ferr.h" #include "lib/ferr.h"
enum zebra_ferr_refs { enum zebra_ferr_refs {
ZEBRA_ERR_LM_RESPONSE, ZEBRA_ERR_LM_RESPONSE = ZEBRA_FERR_START,
ZEBRA_ERR_LM_NO_SUCH_CLIENT, ZEBRA_ERR_LM_NO_SUCH_CLIENT,
ZEBRA_ERR_LM_RELAY_FAILED, ZEBRA_ERR_LM_RELAY_FAILED,
ZEBRA_ERR_LM_NO_SOCKET, ZEBRA_ERR_LM_NO_SOCKET,