lib: zclient.c remove extern struct thread_master *
zclient.c depended upon link time inclusion of a
extern struct thread_master *master. This is a violation of the
namespace of the calling daemon. If a library needs the pointer
pass it in and save it for future use.
This code change also makes the zclient code consistent with
the other lib functions that need to schedule work on your behalf
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/isisd/isis_main.c b/isisd/isis_main.c
index e1af71f..fba7b10 100644
--- a/isisd/isis_main.c
+++ b/isisd/isis_main.c
@@ -339,7 +339,7 @@
/* create the global 'isis' instance */
isis_new (1);
- isis_zebra_init ();
+ isis_zebra_init (master);
/* parse config file */
/* this is needed three times! because we have interfaces before the areas */
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index 6d0c157..8a78417 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -602,9 +602,9 @@
}
void
-isis_zebra_init ()
+isis_zebra_init (struct thread_master *master)
{
- zclient = zclient_new ();
+ zclient = zclient_new (master);
zclient_init (zclient, ZEBRA_ROUTE_ISIS);
zclient->zebra_connected = isis_zebra_connected;
zclient->router_id_update = isis_router_id_update_zebra;
diff --git a/isisd/isis_zebra.h b/isisd/isis_zebra.h
index 889cd9b..0011478 100644
--- a/isisd/isis_zebra.h
+++ b/isisd/isis_zebra.h
@@ -24,7 +24,7 @@
extern struct zclient *zclient;
-void isis_zebra_init (void);
+void isis_zebra_init (struct thread_master *);
void isis_zebra_route_update (struct prefix *prefix,
struct isis_route_info *route_info);
int isis_distribute_list_update (int routetype);