summaryrefslogtreecommitdiff
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 959f9e51c6..be3322e468 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2738,7 +2738,6 @@ int peer_group_listen_range_del(struct peer_group *group, struct prefix *range)
struct listnode *node, *nnode;
struct peer *peer;
afi_t afi;
- char buf[PREFIX2STR_BUFFER];
afi = family2afi(range->family);
@@ -2751,8 +2750,6 @@ int peer_group_listen_range_del(struct peer_group *group, struct prefix *range)
if (!prefix)
return BGP_ERR_DYNAMIC_NEIGHBORS_RANGE_NOT_FOUND;
- prefix2str(prefix, buf, sizeof(buf));
-
/* Dispose off any dynamic neighbors that exist due to this listen range
*/
for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer)) {
@@ -2763,8 +2760,8 @@ int peer_group_listen_range_del(struct peer_group *group, struct prefix *range)
if (prefix_match(prefix, &prefix2)) {
if (bgp_debug_neighbor_events(peer))
zlog_debug(
- "Deleting dynamic neighbor %s group %s upon delete of listen range %s",
- peer->host, group->name, buf);
+ "Deleting dynamic neighbor %s group %s upon delete of listen range %pFX",
+ peer->host, group->name, prefix);
peer_delete(peer);
}
}
@@ -2981,6 +2978,8 @@ static struct bgp *bgp_create(as_t *as, const char *name,
}
bgp_lock(bgp);
+
+ bgp_process_queue_init(bgp);
bgp->heuristic_coalesce = true;
bgp->inst_type = inst_type;
bgp->vrf_id = (inst_type == BGP_INSTANCE_TYPE_DEFAULT) ? VRF_DEFAULT
@@ -3505,6 +3504,9 @@ int bgp_delete(struct bgp *bgp)
bgp_set_evpn(bgp_get_default());
}
+ if (bgp->process_queue)
+ work_queue_free_and_null(&bgp->process_queue);
+
thread_master_free_unused(bm->master);
bgp_unlock(bgp); /* initial reference */
@@ -3770,7 +3772,6 @@ struct peer *peer_lookup_dynamic_neighbor(struct bgp *bgp, union sockunion *su)
struct prefix *listen_range;
int dncount;
char buf[PREFIX2STR_BUFFER];
- char buf1[PREFIX2STR_BUFFER];
sockunion2hostprefix(su, &prefix);
@@ -3787,12 +3788,11 @@ struct peer *peer_lookup_dynamic_neighbor(struct bgp *bgp, union sockunion *su)
return NULL;
prefix2str(&prefix, buf, sizeof(buf));
- prefix2str(listen_range, buf1, sizeof(buf1));
if (bgp_debug_neighbor_events(NULL))
zlog_debug(
- "Dynamic Neighbor %s matches group %s listen range %s",
- buf, group->name, buf1);
+ "Dynamic Neighbor %s matches group %s listen range %pFX",
+ buf, group->name, listen_range);
/* Are we within the listen limit? */
dncount = gbgp->dynamic_neighbors_count;
@@ -7085,8 +7085,6 @@ void bgp_master_init(struct thread_master *master, const int buffer_size)
bm->terminating = false;
bm->socket_buffer = buffer_size;
- bgp_process_queue_init();
-
bgp_mac_init();
/* init the rd id space.
assign 0th index in the bitfield,
@@ -7291,14 +7289,10 @@ void bgp_terminate(void)
bgp_notify_send(peer, BGP_NOTIFY_CEASE,
BGP_NOTIFY_CEASE_PEER_UNCONFIG);
- if (bm->process_main_queue)
- work_queue_free_and_null(&bm->process_main_queue);
-
if (bm->t_rmap_update)
BGP_TIMER_OFF(bm->t_rmap_update);
bgp_mac_finish();
- bgp_evpn_mh_finish();
}
struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp,