From 808e0aa11155da09bebadf213e1e97f1822db545 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 12 Aug 2023 00:06:51 -0400 Subject: [PATCH] pimd: Prevent vxlan from causing a S,G RPT Prune in some cases Upon startup the pim vxlan code initiates a pim null register send for the S,G and sends a *,G join towards the RP at the same time. Since a S,G upstream is created in the vxlan code with the appropriate flags, the *,G join has the embedded S,G RPT Prune. When an intermediate route receives this *,G RPT Prune it creates a blackhole S,G route since this particular intermediate router has not received a join from the RP yet( say the packet is lost, or that part of the network is slower coming up ). Let's try to intelligently decide that the S,G RPT Prune should not be sent as part of the *,G join until the actual S,G join from the RP reaches this box. Then we can make intelligent decisions about whether or not to send it out. Signed-off-by: Donald Sharp --- pimd/pim_msg.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/pimd/pim_msg.c b/pimd/pim_msg.c index 5d1f08314b..6814798bf5 100644 --- a/pimd/pim_msg.c +++ b/pimd/pim_msg.c @@ -196,7 +196,32 @@ size_t pim_msg_get_jp_group_size(struct list *sources) __func__, up->sg_str); for (ALL_LIST_ELEMENTS_RO(up->sources, up_node, child)) { - if (!PIM_UPSTREAM_FLAG_TEST_USE_RPT(child->flags)) { + /* + * PIM VXLAN is weird + * It auto creates the S,G and populates a bunch + * of flags that make it look like a SPT prune should + * be sent. But this regularly scheduled join + * for the *,G in the VXLAN setup can happen at + * scheduled times *before* the null register + * is received by the RP to cause it to initiate + * the S,G joins toward the source. Let's just + * assume that if this is a SRC VXLAN ORIG route + * and no actual ifchannels( joins ) have been + * created then do not send the embedded prune + * Why you may ask? Well if the prune is S,G + * RPT Prune is received *before* the join + * from the RP( if it flows to this routers + * upstream interface ) then we'll just wisely + * create a mroute with an empty oil on + * the upstream intermediate router preventing + * packets from flowing to the RP + */ + if (PIM_UPSTREAM_FLAG_TEST_SRC_VXLAN_ORIG(child->flags) && + listcount(child->ifchannels) == 0) { + if (PIM_DEBUG_PIM_PACKETS) + zlog_debug("%s: %s Vxlan originated S,G route with no ifchannels, not adding prune to compound message", + __func__, child->sg_str); + } else if (!PIM_UPSTREAM_FLAG_TEST_USE_RPT(child->flags)) { /* If we are using SPT and the SPT and RPT IIFs * are different we can prune the source off * of the RPT. -- 2.39.5