diff options
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 67 |
1 files changed, 9 insertions, 58 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 9d149cbb..ff4e0ab4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -129,16 +129,11 @@ bgp_info_extra_get (struct bgp_info *ri) static struct bgp_info * bgp_info_new () { - struct bgp_info *new; - - new = XMALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info)); - memset (new, 0, sizeof (struct bgp_info)); - - return new; + return XCALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info)); } /* Free bgp route information. */ -static void +void bgp_info_free (struct bgp_info *binfo) { if (binfo->attr) @@ -151,39 +146,6 @@ bgp_info_free (struct bgp_info *binfo) XFREE (MTYPE_BGP_ROUTE, binfo); } -struct bgp_info * -bgp_info_lock (struct bgp_info *binfo) -{ - binfo->lock++; - return binfo; -} - -struct bgp_info * -bgp_info_unlock (struct bgp_info *binfo) -{ - assert (binfo && binfo->lock > 0); - binfo->lock--; - - if (binfo->lock == 0) - { -#if 0 - zlog_debug ("%s: unlocked and freeing", __func__); - zlog_backtrace (LOG_DEBUG); -#endif - bgp_info_free (binfo); - return NULL; - } - -#if 0 - if (binfo->lock == 1) - { - zlog_debug ("%s: unlocked to 1", __func__); - zlog_backtrace (LOG_DEBUG); - } -#endif - - return binfo; -} void bgp_info_add (struct bgp_node *rn, struct bgp_info *ri) @@ -2678,10 +2640,10 @@ bgp_clear_node_complete (struct work_queue *wq) { struct peer *peer = wq->spec.data; - peer_unlock (peer); /* bgp_clear_node_complete */ - /* Tickle FSM to start moving again */ BGP_EVENT_ADD (peer, Clearing_Completed); + + peer_unlock (peer); /* bgp_clear_node_complete */ } static void @@ -3121,10 +3083,7 @@ bgp_nlri_sanity_check (struct peer *peer, int afi, u_char *pnt, static struct bgp_static * bgp_static_new () { - struct bgp_static *new; - new = XMALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static)); - memset (new, 0, sizeof (struct bgp_static)); - return new; + return XCALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static)); } static void @@ -4509,10 +4468,7 @@ struct bgp_aggregate static struct bgp_aggregate * bgp_aggregate_new () { - struct bgp_aggregate *new; - new = XMALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate)); - memset (new, 0, sizeof (struct bgp_aggregate)); - return new; + return XCALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate)); } static void @@ -9176,11 +9132,7 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi) vty_out (vty, "%12llu%s", ts.counts[i], VTY_NEWLINE); if (ts.counts[BGP_STATS_MAXBITLEN] < 9) break; -<<<<<<< HEAD:bgpd/bgp_route.c - vty_out (vty, "%30s: ", "\% announced "); -======= vty_out (vty, "%30s: ", "%% announced "); ->>>>>>> 41dc3488cf127a1e23333459a0c316ded67f7ff3:bgpd/bgp_route.c vty_out (vty, "%12.2f%s", 100 * (float)ts.counts[BGP_STATS_SPACE] / (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN]), @@ -10863,10 +10815,7 @@ struct bgp_distance static struct bgp_distance * bgp_distance_new () { - struct bgp_distance *new; - new = XMALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance)); - memset (new, 0, sizeof (struct bgp_distance)); - return new; + return XCALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance)); } static void @@ -10961,6 +10910,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, return CMD_SUCCESS; } +#if 0 static void bgp_distance_reset () { @@ -10977,6 +10927,7 @@ bgp_distance_reset () bgp_unlock_node (rn); } } +#endif /* Apply BGP information to distance method. */ u_char |