dst->v_routeadv = src->v_routeadv;
dst->flags = src->flags;
dst->af_flags[afi][safi] = src->af_flags[afi][safi];
- dst->host = strdup (src->host);
+ dst->host = XSTRDUP (MTYPE_BGP_PEER_HOST, src->host);
dst->cap = src->cap;
dst->af_cap[afi][safi] = src->af_cap[afi][safi];
dst->afc_nego[afi][safi] = src->afc_nego[afi][safi];
hash_release (updgrp->bgp->update_groups[updgrp->afid], updgrp);
conf_release (updgrp->conf, updgrp->afi, updgrp->safi);
+
+ XFREE (MTYPE_BGP_PEER_HOST, updgrp->conf->host);
XFREE (MTYPE_BGP_PEER, updgrp->conf);
XFREE (MTYPE_BGP_UPDGRP, updgrp);
}
}
void
-update_group_init (struct bgp *bgp)
+update_bgp_group_init (struct bgp *bgp)
{
int afid;
updgrp_hash_cmp);
}
+void
+update_bgp_group_free (struct bgp *bgp)
+{
+ int afid;
+
+ AF_FOREACH (afid)
+ {
+ hash_free(bgp->update_groups[afid]);
+ bgp->update_groups[afid] = NULL;
+ }
+}
+
void
update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty,
u_int64_t subgrp_id)
/* Prototypes. */
/* bgp_updgrp.c */
-extern void update_group_init (struct bgp *);
+extern void update_bgp_group_init (struct bgp *);
+extern void udpate_bgp_group_free (struct bgp *);
+
extern void
update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, u_int64_t subgrp_id);
extern void update_group_show_stats (struct bgp *bgp, struct vty *vty);
THREAD_TIMER_ON (master, bgp->t_startup, bgp_startup_timer_expire,
bgp, bgp->restart_time);
- update_group_init(bgp);
+ update_bgp_group_init(bgp);
return bgp;
}
BGP_TIMER_OFF(bgp->t_rmap_def_originate_eval);
bgp_unlock(bgp);
}
-
+
+ update_bgp_group_free (bgp);
/* Remove visibility via the master list - there may however still be
* routes to be processed still referencing the struct bgp.
*/
void
zclient_reset (struct zclient *zclient)
{
+ int afi;
+
zclient_stop (zclient);
+
+ for (afi = AFI_IP; afi < AFI_MAX; afi++)
+ redist_del_instance (&zclient->redist[afi][zclient->redist_default], zclient->instance);
+
zclient_init (zclient, zclient->redist_default, zclient->instance);
}