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/ripd/rip_main.c b/ripd/rip_main.c
index 95b1f6d..4ead9b0 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -286,7 +286,7 @@
/* RIP related initialization. */
rip_init ();
rip_if_init ();
- rip_zclient_init ();
+ rip_zclient_init (master);
rip_peer_init ();
/* Get configuration file. */
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index de98162..0b6c22a 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -710,10 +710,10 @@
}
void
-rip_zclient_init ()
+rip_zclient_init (struct thread_master *master)
{
/* Set default value to the zebra client structure. */
- zclient = zclient_new ();
+ zclient = zclient_new (master);
zclient_init (zclient, ZEBRA_ROUTE_RIP);
zclient->zebra_connected = rip_zebra_connected;
zclient->interface_add = rip_interface_add;
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 4f40e79..a768ccc 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -389,7 +389,7 @@
extern void rip_route_map_init (void);
extern void rip_route_map_reset (void);
extern void rip_snmp_init (void);
-extern void rip_zclient_init (void);
+extern void rip_zclient_init (struct thread_master *);
extern void rip_zclient_start (void);
extern void rip_zclient_reset (void);
extern void rip_offset_init (void);