diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-08 13:50:55 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-08 14:38:11 +0100 |
commit | f849df457e512bec6c87fda1b21c8cdc0960924c (patch) | |
tree | 3f2966eee319856c4243061819cbde0dfe2af522 /pimd | |
parent | pimd: Fix various ifdown/ifup scenarios w/ J/P Agg (diff) | |
download | frr-f849df457e512bec6c87fda1b21c8cdc0960924c.tar.xz frr-f849df457e512bec6c87fda1b21c8cdc0960924c.zip |
pimd: Don't double include Source
When we are adding to a J/P Agg list, don't
double add the source.
Ticket: CM-15189
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_jp_agg.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/pimd/pim_jp_agg.c b/pimd/pim_jp_agg.c index 3ffdbe201..67ddf05d0 100644 --- a/pimd/pim_jp_agg.c +++ b/pimd/pim_jp_agg.c @@ -170,7 +170,7 @@ pim_jp_agg_add_group (struct list *group, struct pim_upstream *up, bool is_join) { struct listnode *node, *nnode; struct pim_jp_agg_group *jag = NULL; - struct pim_jp_sources *js; + struct pim_jp_sources *js = NULL; for (ALL_LIST_ELEMENTS(group, node, nnode, jag)) { @@ -188,11 +188,20 @@ pim_jp_agg_add_group (struct list *group, struct pim_upstream *up, bool is_join) listnode_add (group, jag); } - js = XCALLOC(MTYPE_PIM_JP_AGG_SOURCE, sizeof (struct pim_jp_sources)); - js->up = up; - js->is_join = is_join; + for (ALL_LIST_ELEMENTS(jag->sources, node, nnode, js)) + { + if (js->up->sg.src.s_addr == up->sg.src.s_addr) + break; + } - listnode_add (jag->sources, js); + if (!js) + { + js = XCALLOC(MTYPE_PIM_JP_AGG_SOURCE, sizeof (struct pim_jp_sources)); + js->up = up; + listnode_add (jag->sources, js); + } + + js->is_join = is_join; } void |