pimd: Fix _find and switch_to_spt_desired.

The pim_upstream_find function should not be finding a *,G
Find what is asked of it.

The switch_to_spt_desired should return true on the RP currently.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-07-23 03:33:53 -04:00 committed by Donald Sharp
parent 65e1fcd766
commit a3b58b4a14

View File

@ -381,13 +381,10 @@ struct pim_upstream *pim_upstream_find(struct prefix *sg)
struct pim_upstream *up; struct pim_upstream *up;
for (ALL_LIST_ELEMENTS_RO(qpim_upstream_list, up_node, up)) { for (ALL_LIST_ELEMENTS_RO(qpim_upstream_list, up_node, up)) {
if (sg->u.sg.grp.s_addr == up->sg.u.sg.grp.s_addr) { if ((sg->u.sg.grp.s_addr == up->sg.u.sg.grp.s_addr) &&
if ((up->sg.u.sg.src.s_addr == INADDR_ANY) || (sg->u.sg.src.s_addr == up->sg.u.sg.src.s_addr))
(sg->u.sg.src.s_addr == up->sg.u.sg.src.s_addr)) {
return up; return up;
} }
}
}
return NULL; return NULL;
} }
@ -751,6 +748,9 @@ pim_upstream_keep_alive_timer_start (struct pim_upstream *up,
int int
pim_upstream_switch_to_spt_desired (struct prefix *sg) pim_upstream_switch_to_spt_desired (struct prefix *sg)
{ {
if (I_am_RP (sg->u.sg.grp))
return 1;
return 0; return 0;
} }