From ec85b101e6ba032c17981b9f354f358a0bc67c01 Mon Sep 17 00:00:00 2001 From: Anuradha Karuppiah Date: Wed, 10 Jul 2019 08:00:04 -0700 Subject: [PATCH] pimd: run DF election only on (*, G) termination mroutes (S,G) entries that inherit ipmr-lo into the OIL also inherit the DF role from the parent (*, G) entry. This change is done primarily to simplify the sync process and to prevent the MLAG peers from having to track (S, G) activity etc. Signed-off-by: Anuradha Karuppiah --- pimd/pim_upstream.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index cf333ffccf..c905dd146a 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -853,9 +853,23 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim, up->ifchannels = list_new(); up->ifchannels->cmp = (int (*)(void *, void *))pim_ifchannel_compare; - if (up->sg.src.s_addr != INADDR_ANY) + if (up->sg.src.s_addr != INADDR_ANY) { wheel_add_item(pim->upstream_sg_wheel, up); + /* Inherit the DF role from the parent (*, G) entry for + * VxLAN BUM groups + */ + if (up->parent + && PIM_UPSTREAM_FLAG_TEST_MLAG_VXLAN(up->parent->flags) + && PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up->parent->flags)) { + PIM_UPSTREAM_FLAG_SET_MLAG_NON_DF(up->flags); + if (PIM_DEBUG_VXLAN) + zlog_debug( + "upstream %s inherited mlag non-df flag from parent", + up->sg_str); + } + } + if (PIM_UPSTREAM_FLAG_TEST_STATIC_IIF(up->flags) || PIM_UPSTREAM_FLAG_TEST_SRC_NOCACHE(up->flags)) { pim_upstream_fill_static_iif(up, incoming); @@ -885,19 +899,6 @@ static struct pim_upstream *pim_upstream_new(struct pim_instance *pim, } } - /* If (S, G) inherit the MLAG_VXLAN from the parent - * (*, G) entry. - */ - if ((up->sg.src.s_addr != INADDR_ANY) && - up->parent && - PIM_UPSTREAM_FLAG_TEST_MLAG_VXLAN(up->parent->flags) && - !PIM_UPSTREAM_FLAG_TEST_SRC_VXLAN_ORIG(up->flags)) { - PIM_UPSTREAM_FLAG_SET_MLAG_VXLAN(up->flags); - if (PIM_DEBUG_VXLAN) - zlog_debug("upstream %s inherited mlag vxlan flag from parent", - up->sg_str); - } - /* send the entry to the MLAG peer */ /* XXX - duplicate send is possible here if pim_rpf_update * successfully resolved the nexthop -- 2.39.5