]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Reset neighbor hold time when we receive packet
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 7 Dec 2016 16:01:57 +0000 (11:01 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:18 +0000 (20:26 -0500)
When we receive a packet from a neighbor, reset the
hold time as that we *know* that they are still
alive.

During heavy packet load, we were seeing cases
where neighbors were being reset because we
were timing out due to not processing the hello
packet in time.

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

index 83d3851d9e6370c131693cc863008c42643cd49b..d253ef5412160642c34b77a057c01f16f0c2e921 100644 (file)
@@ -240,26 +240,11 @@ static int on_neighbor_timer(struct thread *t)
   return 0;
 }
 
-static void neighbor_timer_off(struct pim_neighbor *neigh)
-{
-  if (PIM_DEBUG_PIM_TRACE_DETAIL) {
-    if (neigh->t_expire_timer) {
-      char src_str[INET_ADDRSTRLEN];
-      pim_inet4_dump("<src?>", neigh->source_addr, src_str, sizeof(src_str));
-      zlog_debug("%s: cancelling timer for neighbor %s on %s",
-                __PRETTY_FUNCTION__,
-                src_str, neigh->interface->name);
-    }
-  }
-  THREAD_OFF(neigh->t_expire_timer);
-  zassert(!neigh->t_expire_timer);
-}
-
 void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime)
 {
   neigh->holdtime = holdtime;
 
-  neighbor_timer_off(neigh);
+  THREAD_OFF(neigh->t_expire_timer);
 
   /*
     0xFFFF is request for no holdtime
@@ -571,7 +556,7 @@ void pim_neighbor_delete(struct interface *ifp,
   zlog_info("PIM NEIGHBOR DOWN: neighbor %s on interface %s: %s",
            src_str, ifp->name, delete_message);
 
-  neighbor_timer_off(neigh);
+  THREAD_OFF(neigh->t_expire_timer);
 
   pim_if_assert_on_neighbor_down(ifp, neigh->source_addr);
 
index b973adacc424757823dca7207d80f40bc2321bb3..f9d74ff0399cd6b71f3af97ae6ded525acffbc0d 100644 (file)
@@ -245,6 +245,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
                     pim_type, src_str, ifp->name);
        return -1;
       }
+      pim_neighbor_timer_reset(neigh, neigh->holdtime);
       return pim_joinprune_recv(ifp, neigh,
                                ip_hdr->ip_src,
                                pim_msg + PIM_MSG_HEADER_LEN,
@@ -259,6 +260,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
                     pim_type, src_str, ifp->name);
        return -1;
       }
+      pim_neighbor_timer_reset(neigh, neigh->holdtime);
       return pim_assert_recv(ifp, neigh,
                             ip_hdr->ip_src,
                             pim_msg + PIM_MSG_HEADER_LEN,