summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-09-24 09:25:19 -0400
committerPaul Jakma <paul@quagga.net>2015-10-27 10:53:21 +0000
commit7125293d65d73a451ec203c8c1630c236171f5a3 (patch)
treef9d118c9a8f8374d69fb9c75c87531a2ca478fb2 /bgpd
parentfd1c1a133af47ae5533a5ed41b73ff62e7aa1058 (diff)
downloadquagga-7125293d65d73a451ec203c8c1630c236171f5a3.tar.bz2
quagga-7125293d65d73a451ec203c8c1630c236171f5a3.tar.xz
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>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_nexthop.c2
-rw-r--r--bgpd/bgp_zebra.c4
-rw-r--r--bgpd/bgp_zebra.h2
-rw-r--r--bgpd/bgpd.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 20302e39..33de365e 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -1402,7 +1402,7 @@ bgp_config_write_scan_time (struct vty *vty)
void
bgp_scan_init (void)
{
- zlookup = zclient_new ();
+ zlookup = zclient_new (master);
zlookup->sock = -1;
zlookup->t_connect = thread_add_event (master, zlookup_connect, zlookup, 0);
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 26163516..e534bee8 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1094,10 +1094,10 @@ bgp_zebra_connected (struct zclient *zclient)
}
void
-bgp_zebra_init (void)
+bgp_zebra_init (struct thread_master *master)
{
/* Set default values. */
- zclient = zclient_new ();
+ zclient = zclient_new (master);
zclient_init (zclient, ZEBRA_ROUTE_BGP);
zclient->zebra_connected = bgp_zebra_connected;
zclient->router_id_update = bgp_router_id_update;
diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h
index 80991930..50f727df 100644
--- a/bgpd/bgp_zebra.h
+++ b/bgpd/bgp_zebra.h
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
extern struct stream *bgp_nexthop_buf;
-extern void bgp_zebra_init (void);
+extern void bgp_zebra_init (struct thread_master *master);
extern int bgp_if_update_all (void);
extern int bgp_config_write_maxpaths (struct vty *, struct bgp *, afi_t,
safi_t, int *);
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 00680372..af8bdb45 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -5421,7 +5421,7 @@ bgp_init (void)
bgp_vty_init ();
/* Init zebra. */
- bgp_zebra_init ();
+ bgp_zebra_init (master);
/* BGP inits. */
bgp_attr_init ();