}
}
-void pim_ifchannel_free(struct pim_ifchannel *ch)
-{
- XFREE(MTYPE_PIM_IFCHANNEL, ch);
-}
-
void pim_ifchannel_delete(struct pim_ifchannel *ch)
{
struct pim_interface *pim_ifp;
zlog_debug("%s: ifchannel entry %s is deleted ",
__PRETTY_FUNCTION__, ch->sg_str);
- pim_ifchannel_free(ch);
+ XFREE(MTYPE_PIM_IFCHANNEL, ch);
}
void pim_ifchannel_delete_all(struct interface *ifp)
RB_PROTOTYPE(pim_ifchannel_rb, pim_ifchannel, pim_ifp_rb,
pim_ifchannel_compare);
-void pim_ifchannel_free(struct pim_ifchannel *ch);
void pim_ifchannel_delete(struct pim_ifchannel *ch);
void pim_ifchannel_delete_all(struct interface *ifp);
void pim_ifchannel_membership_clear(struct interface *ifp);
struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
struct pim_upstream *up, const char *name)
{
+ struct listnode *node, *nnode;
+ struct pim_ifchannel *ch;
bool notify_msdp = false;
struct prefix nht_p;
notify_msdp = true;
}
- pim_upstream_remove_children(pim, up);
- if (up->sources)
- list_delete_and_null(&up->sources);
-
pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__);
upstream_channel_oil_detach(up);
+ for (ALL_LIST_ELEMENTS(up->ifchannels, node, nnode, ch))
+ pim_ifchannel_delete(ch);
list_delete_and_null(&up->ifchannels);
+ pim_upstream_remove_children(pim, up);
+ if (up->sources)
+ list_delete_and_null(&up->sources);
+
if (up->parent && up->parent->sources)
listnode_delete(up->parent->sources, up);
up->parent = NULL;