diff options
-rw-r--r-- | bgpd/bgp_main.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 10 | ||||
-rw-r--r-- | bgpd/bgp_snmp.c | 2 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 2 | ||||
-rw-r--r-- | bgpd/bgpd.c | 3 | ||||
-rw-r--r-- | bgpd/bgpd.h | 3 | ||||
-rw-r--r-- | tests/aspath_test.c | 2 |
7 files changed, 16 insertions, 10 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 2a9f7a223..09e83b8a5 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -329,7 +329,6 @@ main (int argc, char **argv) /* BGP master init. */ bgp_master_init (); - master = thread_master_create(); /* Command line argument treatment. */ while (1) @@ -408,6 +407,9 @@ main (int argc, char **argv) } } + /* Make thread master. */ + master = bm->master; + /* Initializations. */ srand (time (NULL)); signal_init (master, array_size(bgp_signals), bgp_signals); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 104abe05f..256561f2d 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -2177,13 +2177,13 @@ bgp_process_queue_init (void) if (!bm->process_main_queue) { bm->process_main_queue - = work_queue_new(master, "process_main_queue"); + = work_queue_new (bm->master, "process_main_queue"); } if (!bm->process_rsclient_queue) { bm->process_rsclient_queue - = work_queue_new(master, "process_rsclient_queue"); + = work_queue_new (bm->master, "process_rsclient_queue"); } if ( !(bm->process_main_queue && bm->process_rsclient_queue) ) @@ -3430,7 +3430,7 @@ bgp_clear_node_queue_init (struct peer *peer) snprintf (wname, sizeof(wname), "clear %s", peer->host); #undef CLEAR_QUEUE_NAME_LEN - if ( (peer->clear_node_queue = work_queue_new (master, wname)) == NULL) + if ( (peer->clear_node_queue = work_queue_new (bm->master, wname)) == NULL) { zlog_err ("%s: Failed to allocate work queue", __func__); exit (1); @@ -11577,7 +11577,7 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) memset (&ts, 0, sizeof (ts)); ts.table = bgp->rib[afi][safi]; - thread_execute (master, bgp_table_stats_walker, &ts, 0); + thread_execute (bm->master, bgp_table_stats_walker, &ts, 0); vty_out (vty, "BGP %s RIB statistics%s%s", afi_safi_print (afi, safi), VTY_NEWLINE, VTY_NEWLINE); @@ -11884,7 +11884,7 @@ bgp_peer_counts (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi, u_c * * stats for the thread-walk (i.e. ensure this can't be blamed on * * on just vty_read()). * */ - thread_execute(master, bgp_peer_count_walker, &pcounts, 0); + thread_execute (bm->master, bgp_peer_count_walker, &pcounts, 0); if (use_json) { diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 078cb0cc1..79aaa03a6 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -888,7 +888,7 @@ bgpTrapBackwardTransition (struct peer *peer) void bgp_snmp_init (void) { - smux_init(master); + smux_init (bm->master); REGISTER_MIB("mibII/bgp", bgp_variables, variable, bgp_oid); } #endif /* HAVE_SNMP */ diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 3129a4135..d2c0a41ba 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -4946,7 +4946,7 @@ DEFUN (bgp_set_route_map_delay_timer, if (!rmap_delay_timer && bgp->t_rmap_update ) { BGP_TIMER_OFF(bgp->t_rmap_update); - thread_execute(master, bgp_route_map_update_timer, &bgp, 0); + thread_execute (bm->master, bgp_route_map_update_timer, &bgp, 0); } return CMD_SUCCESS; } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 61a416ab7..32966c494 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2904,7 +2904,7 @@ bgp_delete (struct bgp *bgp) if (list_isempty(bm->bgp)) bgp_close (); - thread_master_free_unused(master); + thread_master_free_unused(bm->master); bgp_unlock(bgp); /* initial reference */ return 0; @@ -6874,6 +6874,7 @@ bgp_master_init (void) bm->bgp = list_new (); bm->listen_sockets = list_new (); bm->port = BGP_PORT_DEFAULT; + bm->master = thread_master_create (); bm->start_time = bgp_clock (); bgp_process_queue_init(); diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 651cf1509..00e6a1a1f 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -79,6 +79,9 @@ struct bgp_master /* BGP instance list. */ struct list *bgp; + /* BGP thread master. */ + struct thread_master *master; + /* work queues */ struct work_queue *process_main_queue; struct work_queue *process_rsclient_queue; diff --git a/tests/aspath_test.c b/tests/aspath_test.c index f39e46550..8ba77b122 100644 --- a/tests/aspath_test.c +++ b/tests/aspath_test.c @@ -1287,7 +1287,7 @@ main (void) { int i = 0; bgp_master_init (); - master = thread_master_create(); + master = bm->master; bgp_option_set (BGP_OPT_NO_LISTEN); bgp_attr_init (); |