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/ripngd/ripng_main.c b/ripngd/ripng_main.c
index d8f2241..1c184e2 100644
--- a/ripngd/ripng_main.c
+++ b/ripngd/ripng_main.c
@@ -281,7 +281,7 @@
/* RIPngd inits. */
ripng_init ();
- zebra_init ();
+ zebra_init (master);
ripng_peer_init ();
/* Get configuration file. */
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index 58f8860..13b1853 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -541,10 +541,10 @@
/* Initialize zebra structure and it's commands. */
void
-zebra_init ()
+zebra_init (struct thread_master *master)
{
/* Allocate zebra structure. */
- zclient = zclient_new ();
+ zclient = zclient_new (master);
zclient_init (zclient, ZEBRA_ROUTE_RIPNG);
zclient->zebra_connected = ripng_zebra_connected;
diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h
index 28ca41b..6cbbd84 100644
--- a/ripngd/ripngd.h
+++ b/ripngd/ripngd.h
@@ -358,7 +358,7 @@
extern void ripng_route_map_reset (void);
extern void ripng_terminate (void);
/* zclient_init() is done by ripng_zebra.c:zebra_init() */
-extern void zebra_init (void);
+extern void zebra_init (struct thread_master *);
extern void ripng_zclient_start (void);
extern void ripng_zclient_reset (void);
extern void ripng_offset_init (void);