diff options
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 63 |
1 files changed, 9 insertions, 54 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 50407e4e..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 @@ -10859,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 @@ -10957,6 +10910,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, return CMD_SUCCESS; } +#if 0 static void bgp_distance_reset () { @@ -10973,6 +10927,7 @@ bgp_distance_reset () bgp_unlock_node (rn); } } +#endif /* Apply BGP information to distance method. */ u_char |