]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Intelligently drop wrvifwhole packets in some cases
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 15 Feb 2017 01:03:18 +0000 (20:03 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 24 Feb 2017 15:03:41 +0000 (10:03 -0500)
Suppose we have this

(*,G) IIF = swp1  OIL: swp3
(S,G) IIF = swp2  OIL: swp3 swp4

There exists situations where we can receive the mcast
packet for (S,G) on both swp1 and swp2.  In this case
the packet received on swp1 will be sent from the kernel
to us as a WRVIF and WRVIFWHOLE.

As per normal, WRVIF packet processing handles the assert
case so we know we have not received the packet on a downstream
interface, so no assert.

The WRVIFWHOLE packet processing can then check to see if
it received the packet as a result of the (*,G) mroute
from upstream.  If we have then we can safely drop
the packet.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c

index 4fae5b3ca5fee9be3725e8eb44a185bf3069b8e7..ae5d0e9891ae907c1bcb5c6ec28be107c1f07639 100644 (file)
@@ -351,7 +351,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
   struct pim_interface *pim_ifp;
   struct pim_ifchannel *ch;
   struct pim_upstream *up;
-  //struct prefix_sg star_g;
+  struct prefix_sg star_g;
   struct prefix_sg sg;
   struct channel_oil *oil;
 
@@ -367,9 +367,10 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
                    ch->sg_str, ifp->name);
       return -1;
     }
-#if 0
+
   star_g = sg;
   star_g.src.s_addr = INADDR_ANY;
+#if 0
   ch = pim_ifchannel_find(ifp, &star_g);
   if (ch)
     {
@@ -383,11 +384,22 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
   up = pim_upstream_find (&sg);
   if (up)
     {
+      struct pim_upstream *parent;
       struct pim_nexthop source;
       struct pim_rpf *rpf = RP (sg.grp);
       if (!rpf || !rpf->source_nexthop.interface)
         return 0;
 
+      /*
+       * If we have received a WRVIFWHOLE and are at this
+       * point, we could be receiving the packet on the *,G
+       * tree, let's check and if so we can safely drop
+       * it.
+       */
+      parent = pim_upstream_find (&star_g);
+      if (parent && parent->rpf.source_nexthop.interface == ifp)
+        return 0;
+
       pim_ifp = rpf->source_nexthop.interface->info;
 
       memset (&source, 0, sizeof (source));