forked from Mirror/frr
pimd: jp-agg list update debug logs
Added event logs around add/del of upstream entries into the nbr's jp-agg list. This is to help debug a problem with stale (deleted) upstream entries being present in the list causing pimd to crash on the periodic processing. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
parent
c692bd2ad4
commit
c5cdf06960
|
@ -148,7 +148,8 @@ pim_jp_agg_get_interface_upstream_switch_list(struct pim_rpf *rpf)
|
|||
return pius;
|
||||
}
|
||||
|
||||
void pim_jp_agg_remove_group(struct list *group, struct pim_upstream *up)
|
||||
void pim_jp_agg_remove_group(struct list *group, struct pim_upstream *up,
|
||||
struct pim_neighbor *nbr)
|
||||
{
|
||||
struct listnode *node, *nnode;
|
||||
struct pim_jp_agg_group *jag = NULL;
|
||||
|
@ -167,6 +168,20 @@ void pim_jp_agg_remove_group(struct list *group, struct pim_upstream *up)
|
|||
break;
|
||||
}
|
||||
|
||||
if (nbr) {
|
||||
if (PIM_DEBUG_TRACE) {
|
||||
char src_str[INET_ADDRSTRLEN];
|
||||
|
||||
pim_inet4_dump("<src?>", nbr->source_addr, src_str,
|
||||
sizeof(src_str));
|
||||
zlog_debug(
|
||||
"up %s remove from nbr %s/%s jp-agg-list",
|
||||
up->sg_str,
|
||||
nbr->interface->name,
|
||||
src_str);
|
||||
}
|
||||
}
|
||||
|
||||
if (js) {
|
||||
js->up = NULL;
|
||||
listnode_delete(jag->sources, js);
|
||||
|
@ -254,7 +269,7 @@ void pim_jp_agg_upstream_verification(struct pim_upstream *up, bool ignore)
|
|||
}
|
||||
|
||||
void pim_jp_agg_add_group(struct list *group, struct pim_upstream *up,
|
||||
bool is_join)
|
||||
bool is_join, struct pim_neighbor *nbr)
|
||||
{
|
||||
struct listnode *node, *nnode;
|
||||
struct pim_jp_agg_group *jag = NULL;
|
||||
|
@ -280,6 +295,20 @@ void pim_jp_agg_add_group(struct list *group, struct pim_upstream *up,
|
|||
break;
|
||||
}
|
||||
|
||||
if (nbr) {
|
||||
if (PIM_DEBUG_TRACE) {
|
||||
char src_str[INET_ADDRSTRLEN];
|
||||
|
||||
pim_inet4_dump("<src?>", nbr->source_addr, src_str,
|
||||
sizeof(src_str));
|
||||
zlog_debug(
|
||||
"up %s add to nbr %s/%s jp-agg-list",
|
||||
up->sg_str,
|
||||
up->rpf.source_nexthop.interface->name,
|
||||
src_str);
|
||||
}
|
||||
}
|
||||
|
||||
if (!js) {
|
||||
js = XCALLOC(MTYPE_PIM_JP_AGG_SOURCE,
|
||||
sizeof(struct pim_jp_sources));
|
||||
|
@ -320,11 +349,11 @@ void pim_jp_agg_switch_interface(struct pim_rpf *orpf, struct pim_rpf *nrpf,
|
|||
|
||||
/* send Prune(S,G) to the old upstream neighbor */
|
||||
if (opius)
|
||||
pim_jp_agg_add_group(opius->us, up, false);
|
||||
pim_jp_agg_add_group(opius->us, up, false, NULL);
|
||||
|
||||
/* send Join(S,G) to the current upstream neighbor */
|
||||
if (npius)
|
||||
pim_jp_agg_add_group(npius->us, up, true);
|
||||
pim_jp_agg_add_group(npius->us, up, true, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,10 +37,11 @@ void pim_jp_agg_group_list_free(struct pim_jp_agg_group *jag);
|
|||
int pim_jp_agg_group_list_cmp(void *arg1, void *arg2);
|
||||
|
||||
void pim_jp_agg_clear_group(struct list *group);
|
||||
void pim_jp_agg_remove_group(struct list *group, struct pim_upstream *up);
|
||||
void pim_jp_agg_remove_group(struct list *group, struct pim_upstream *up,
|
||||
struct pim_neighbor *nbr);
|
||||
|
||||
void pim_jp_agg_add_group(struct list *group, struct pim_upstream *up,
|
||||
bool is_join);
|
||||
bool is_join, struct pim_neighbor *nbr);
|
||||
|
||||
void pim_jp_agg_switch_interface(struct pim_rpf *orpf, struct pim_rpf *nrpf,
|
||||
struct pim_upstream *up);
|
||||
|
|
|
@ -190,6 +190,11 @@ struct pim_upstream *pim_upstream_del(struct pim_instance *pim,
|
|||
if (up->ref_count >= 1)
|
||||
return up;
|
||||
|
||||
if (PIM_DEBUG_TRACE)
|
||||
zlog_debug(
|
||||
"pim_upstream free vrf:%s %s flags 0x%x",
|
||||
pim->vrf->name, up->sg_str, up->flags);
|
||||
|
||||
THREAD_OFF(up->t_ka_timer);
|
||||
THREAD_OFF(up->t_rs_timer);
|
||||
THREAD_OFF(up->t_msdp_reg_timer);
|
||||
|
@ -333,7 +338,7 @@ static void join_timer_stop(struct pim_upstream *up)
|
|||
up->rpf.rpf_addr.u.prefix4);
|
||||
|
||||
if (nbr)
|
||||
pim_jp_agg_remove_group(nbr->upstream_jp_agg, up);
|
||||
pim_jp_agg_remove_group(nbr->upstream_jp_agg, up, nbr);
|
||||
|
||||
pim_jp_agg_upstream_verification(up, false);
|
||||
}
|
||||
|
@ -355,7 +360,7 @@ void join_timer_start(struct pim_upstream *up)
|
|||
}
|
||||
|
||||
if (nbr)
|
||||
pim_jp_agg_add_group(nbr->upstream_jp_agg, up, 1);
|
||||
pim_jp_agg_add_group(nbr->upstream_jp_agg, up, 1, nbr);
|
||||
else {
|
||||
THREAD_OFF(up->t_join_timer);
|
||||
thread_add_timer(router->master, on_join_timer, up,
|
||||
|
|
|
@ -271,7 +271,7 @@ void pim_zebra_upstream_rpf_changed(struct pim_instance *pim,
|
|||
nbr = pim_neighbor_find(old->source_nexthop.interface,
|
||||
old->rpf_addr.u.prefix4);
|
||||
if (nbr)
|
||||
pim_jp_agg_remove_group(nbr->upstream_jp_agg, up);
|
||||
pim_jp_agg_remove_group(nbr->upstream_jp_agg, up, nbr);
|
||||
|
||||
/*
|
||||
* We have detected a case where we might need
|
||||
|
|
Loading…
Reference in a new issue