]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix ifchannel being left around
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 14 Oct 2016 15:22:12 +0000 (11:22 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:11 +0000 (20:26 -0500)
In some situations, the deletion of the ifchannel would
not ocurr if the last flag cleared was the assert flag.

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

index 93a6cad649d65984e92a73cba9e1926dd64a2562..1be7ebb4a996c812c65c4c4d3971f1fdc8013a6e 100644 (file)
@@ -143,27 +143,13 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch)
 
   pim_ifchannel_free(ch);
 }
-
-#define IFCHANNEL_NOINFO(ch)                                   \
-  (                                                            \
-   ((ch)->local_ifmembership == PIM_IFMEMBERSHIP_NOINFO)       \
-   &&                                                          \
-   ((ch)->ifjoin_state == PIM_IFJOIN_NOINFO)                   \
-   &&                                                          \
-   ((ch)->ifassert_state == PIM_IFASSERT_NOINFO)               \
-   )
    
 static void delete_on_noinfo(struct pim_ifchannel *ch)
 {
-  if (IFCHANNEL_NOINFO(ch)) {
-
-    /* In NOINFO state, timers should have been cleared */
-    zassert(!ch->t_ifjoin_expiry_timer);
-    zassert(!ch->t_ifjoin_prune_pending_timer);
-    zassert(!ch->t_ifassert_timer);
-    
+  if (ch->local_ifmembership == PIM_IFMEMBERSHIP_NOINFO &&
+      ch->ifjoin_state == PIM_IFJOIN_NOINFO)
     pim_ifchannel_delete(ch);
-  }
+
 }
 
 void pim_ifchannel_ifjoin_switch(const char *caller,
@@ -191,11 +177,8 @@ void pim_ifchannel_ifjoin_switch(const char *caller,
   ch->ifjoin_state = new_state;
 
   /* Transition to/from NOINFO ? */
-  if (
-      (old_state == PIM_IFJOIN_NOINFO)
-      ||
-      (new_state == PIM_IFJOIN_NOINFO)
-      ) {
+  if ((old_state == PIM_IFJOIN_NOINFO) ||
+      (new_state == PIM_IFJOIN_NOINFO)) {
 
     if (PIM_DEBUG_PIM_EVENTS) {
       zlog_debug("PIM_IFCHANNEL_%s: (S,G)=%s on interface %s",
@@ -432,8 +415,6 @@ pim_ifchannel_add(struct interface *ifp,
   /* Attach to list */
   listnode_add_sort(pim_ifp->pim_ifchannel_list, ch);
 
-  zassert(IFCHANNEL_NOINFO(ch));
-
   return ch;
 }
 
@@ -695,8 +676,6 @@ void pim_ifchannel_join_add(struct interface *ifp,
     break;
   }
 
-  zassert(!IFCHANNEL_NOINFO(ch));
-
   if (holdtime != 0xFFFF) {
     THREAD_TIMER_ON(master, ch->t_ifjoin_expiry_timer,
                    on_ifjoin_expiry_timer,
@@ -782,8 +761,6 @@ void pim_ifchannel_local_membership_add(struct interface *ifp,
 
   ifmembership_set(ch, PIM_IFMEMBERSHIP_INCLUDE);
 
-  zassert(!IFCHANNEL_NOINFO(ch));
-
   if (sg->src.s_addr == INADDR_ANY)
     {
       struct pim_upstream *up = pim_upstream_find (sg);