pimd: Remember to delete reference to upstream in failure

When creating the pim upstream data structure, if we fail
to create remove the reference we saved to it on the side
in the pnc code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-03-14 07:58:17 -04:00
parent e711cd3cec
commit ec97ac6593

View File

@ -621,10 +621,17 @@ pim_upstream_new (struct prefix_sg *sg,
rpf_result = pim_rpf_update(up, NULL, 1);
if (rpf_result == PIM_RPF_FAILURE) {
struct prefix nht_p;
if (PIM_DEBUG_TRACE)
zlog_debug ("%s: Attempting to create upstream(%s), Unable to RPF for source", __PRETTY_FUNCTION__,
up->sg_str);
nht_p.family = AF_INET;
nht_p.prefixlen = IPV4_MAX_BITLEN;
nht_p.u.prefix4 = up->upstream_addr;
pim_delete_tracked_nexthop (&nht_p, up, NULL);
if (up->parent)
{
listnode_delete (up->parent->sources, up);