Donald,

We have been using pimd for a couple of years and we had submitted several bug fixes that seem to have made it to the official sources which is great, especially with the addition of pimd to the official Quagga. There are several places in the code where asserts appear to be an "overkill". In at least two locations, we replaced asserts with warnings and bail out of the function where the condition that triggers the assert occurs. pimd just moves on afterward instead of terminating when the error shouldn't have been fatal to begin with I think. Here is an example:

diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 9d8e001..93ec09f 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -301,6 +301,21 @@ int pim_joinprune_send(struct interface *ifp,
   int pim_msg_size;
   int remain;

+  /* TODO: should we die or bail out ? */
+  if (!ifp) {
+    char source_str[100];
+    char group_str[100];
+    char dst_str[100];
+    pim_inet4_dump("<src?>", source_addr, source_str, sizeof(source_str));
+    pim_inet4_dump("<grp?>", group_addr, group_str, sizeof(group_str));
+    pim_inet4_dump("<dst?>", upstream_addr, dst_str, sizeof(dst_str));
+    zlog_warn("%s: no interface for pim %s(S,G)=(%s,%s) to upstream=%s",
+                __PRETTY_FUNCTION__,
+                send_join ? "Join": "Prune",
+                source_str, group_str, dst_str);
+    return 0;
+  }
+
   zassert(ifp);

   pim_ifp = ifp->info;

Does this make sense, or is this a terrible idea?! I can bring up at least another example. The main goal is to determine if these are really fatal or recoverable errors.

Thanks,
Jafar

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to