]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Add some code to intelligently handle WHOLEPKT generation
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Oct 2015 14:10:30 +0000 (07:10 -0700)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 26 May 2016 00:38:35 +0000 (20:38 -0400)
When we get a NOCACHE call from the kernel, there is
no point generating a mcast route for the packet if
there is no RP configured, or if PIM-SSM is configured
on the interface.

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

index 4ee2f9b85179ea3474b5957dd7152c7eb4efc116..6e48222852581949a2a9c428185db448f15a3995 100644 (file)
@@ -72,6 +72,22 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
                        const char *src_str, const char *grp_str)
 {
   struct mfcctl mc;
+  struct pim_interface *pim_ifp = ifp->info;
+
+  /*
+   * If the incoming interface is unknown OR
+   * the Interface type is SSM we don't need to
+   * do anything here
+   */
+  if ((qpim_rp.s_addr == INADDR_NONE) ||
+      (!pim_ifp) ||
+      (pim_ifp->itype == PIM_INTERFACE_SSM))
+    return 0;
+
+  if (PIM_DEBUG_PIM_TRACE) {
+    zlog_debug("%s: Adding a Route for %s from %s for WHOLEPKT consumption",
+              __PRETTY_FUNCTION__, grp_str, src_str);
+  }
 
   /*
    * This is just a hack to get the (S,G) received packet up into
@@ -92,6 +108,13 @@ static int
 pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const struct igmpmsg *msg,
                         const char *src_str, const char *grp_str)
 {
+
+  if (qpim_rp.s_addr == INADDR_NONE) {
+    if (PIM_DEBUG_PIM_TRACE) {
+      zlog_debug("%s: Received WHOLEPKT with no RP configured to send it to",
+                __PRETTY_FUNCTION__);
+    }
+  }
   return 0;
 }
 
index eaafa46ae82a5ef225f9ca9b618a99516c0840d2..d3cd91673ca7c3081d86933d631174ce305b5b0e 100644 (file)
@@ -45,7 +45,7 @@ pim_rp_check_rp (struct in_addr old, struct in_addr new)
     zlog_debug("%s: %s for old %s new %s", __func__, rp, sold, snew );
   }
 
-  if (qpim_rp.s_addr == 0)
+  if (qpim_rp.s_addr == INADDR_NONE)
     return;
 
   if (new.s_addr == qpim_rp.s_addr)
@@ -98,7 +98,7 @@ pim_rp_g (struct in_addr group)
 int
 pim_rp_set_upstream_addr (struct in_addr *up, struct in_addr source)
 {
-  if ((qpim_rp.s_addr == 0) && (source.s_addr == 0xFFFFFFFF))
+  if ((qpim_rp.s_addr == INADDR_NONE) && (source.s_addr == 0xFFFFFFFF))
     {
       if (PIM_DEBUG_PIM_TRACE)
        zlog_debug("%s: Received a (*,G) with no RP configured", __PRETTY_FUNCTION__);
index 8ed110dc5cbb60000a831efd401a8e225d126e3f..3b2be7975a7fa732681ffa4c97142f27511351ad 100644 (file)
@@ -69,7 +69,7 @@ int64_t                   qpim_mroute_add_last = 0;
 int64_t                   qpim_mroute_del_events = 0;
 int64_t                   qpim_mroute_del_last = 0;
 struct list              *qpim_static_route_list = 0;
-struct in_addr            qpim_rp;
+struct in_addr            qpim_rp = { .s_addr = INADDR_NONE };
 
 int32_t qpim_register_suppress_time = PIM_REGISTER_SUPPRESSION_TIME_DEFAULT;
 int32_t qpim_register_probe_time = PIM_REGISTER_PROBE_TIME_DEFAULT;