if (child)
child->parent = NULL;
}
- list_delete(up->sources);
- up->sources = NULL;
+ list_delete_and_null(&up->sources);
}
/*
pim_upstream_remove_children(pim, up);
if (up->sources)
- list_delete(up->sources);
- up->sources = NULL;
+ list_delete_and_null(&up->sources);
+
pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__);
upstream_channel_oil_detach(up);
- list_delete(up->ifchannels);
- up->ifchannels = NULL;
+ list_delete_and_null(&up->ifchannels);
/*
notice that listnode_delete() can't be moved
pim_upstream_remove_children(pim, up);
if (up->sources)
- list_delete(up->sources);
+ list_delete_and_null(&up->sources);
- list_delete(up->ifchannels);
+ list_delete_and_null(&up->ifchannels);
hash_release(pim->upstream_hash, up);
XFREE(MTYPE_PIM_UPSTREAM, up);
struct pim_upstream *up)
{
struct interface *ifp;
- struct listnode *node;
struct pim_ifchannel *ch, *starch;
struct pim_upstream *starup = up->parent;
int ret = 0;
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pim->vrf_id), node, ifp)) {
+ FOR_ALL_INTERFACES (pim->vrf, ifp) {
if (!ifp->info)
continue;
struct interface *ifp;
struct pim_interface *pim_ifp = NULL;
struct pim_ifchannel *ch, *starch;
- struct listnode *node;
struct pim_upstream *starup = up->parent;
int output_intf = 0;
up->channel_oil = pim_channel_oil_add(
pim, &up->sg, pim_ifp->mroute_vif_index);
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(pim->vrf_id), node, ifp)) {
+ FOR_ALL_INTERFACES (pim->vrf, ifp) {
if (!ifp->info)
continue;
void pim_upstream_terminate(struct pim_instance *pim)
{
if (pim->upstream_list)
- list_delete(pim->upstream_list);
- pim->upstream_list = NULL;
+ list_delete_and_null(&pim->upstream_list);
if (pim->upstream_hash)
hash_free(pim->upstream_hash);