[quagga-dev 12714] Re: pimd fatal asserts

Everton Marques everton.marques at gmail.com
Fri Jun 12 23:25:06 BST 2015


Donald,

I propose a different fix, sketched below, yet untested.
The reason is RPF information is refreshed upon unicast routing changes.
Then when pimd fails to solve the RPF, it could yet set the interface to
NULL.
Though this does not happen on current code, it might be changed.

Cheers,
Everton


diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index e253a0e..b1bea87 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -392,6 +392,7 @@ static void prune_echo(struct interface *ifp,
   struct pim_interface *pim_ifp;
   struct in_addr neigh_dst_addr;

+  zassert(ifp);
   pim_ifp = ifp->info;
   zassert(pim_ifp);

@@ -431,6 +432,7 @@ static int on_ifjoin_prune_pending_timer(struct thread
*t)

   /* Send PruneEcho(S,G) ? */
   ifp = ch->interface;
+  zassert(ifp);
   pim_ifp = ifp->info;
   send_prune_echo = (listcount(pim_ifp->pim_neighbor_list) > 1);

diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index d02f915..97a0ba1 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -96,6 +96,21 @@ static void send_join(struct pim_upstream *up)
       /* warning only */
     }
   }
+
+  if (!up->rpf.source_nexthop.interface) {
+    if (PIM_DEBUG_PIM_TRACE) {
+      char src_str[100];
+      char grp_str[100];
+      pim_inet4_dump("<src?>", up->source_addr, src_str, sizeof(src_str));
+      pim_inet4_dump("<grp?>", up->group_addr, grp_str, sizeof(grp_str));
+      zlog_warn("%s: can't send join upstream: missing RPF_interface(S)
for (S=G)=(%s,%s)",
+               __PRETTY_FUNCTION__, src_str, grp_str);
+    }
+
+    return;
+  }
+
+  zassert(up->rpf.source_nexthop.interface);

   /* send Join(S,G) to the current upstream neighbor */
   pim_joinprune_send(up->rpf.source_nexthop.interface,
@@ -334,6 +349,20 @@ static void pim_upstream_switch(struct pim_upstream
*up,
   }
   else {
     forward_off(up);
+
+    if (!up->rpf.source_nexthop.interface) {
+      if (PIM_DEBUG_PIM_TRACE) {
+       char src_str[100];
+       char grp_str[100];
+       pim_inet4_dump("<src?>", up->source_addr, src_str, sizeof(src_str));
+       pim_inet4_dump("<grp?>", up->group_addr, grp_str, sizeof(grp_str));
+       zlog_warn("%s: can't send prune upstream: missing RPF_interface(S)
for (S=G)=(%s,%s)",
+                 __PRETTY_FUNCTION__, src_str, grp_str);
+      }
+      return;
+    }
+    zassert(up->rpf.source_nexthop.interface);
+
     pim_joinprune_send(up->rpf.source_nexthop.interface,
                       up->rpf.rpf_addr,
                       up->source_addr,
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index dfc871b..822abdf 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -354,6 +354,8 @@ static void scan_upstream_rpf_cache()
     if (rpf_result == PIM_RPF_FAILURE)
       continue;

+    zassert(up->rpf.source_nexthop.interface);
+
     if (rpf_result == PIM_RPF_CHANGED) {

       if (up->join_state == PIM_UPSTREAM_JOINED) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20150612/7c77afa5/attachment-0001.html>


More information about the Quagga-dev mailing list