]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Send hello immediately with receive of new genid
authorDonald Sharp <sharpd@cumulusnetwroks.com>
Sat, 6 Aug 2016 10:26:05 +0000 (06:26 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:05 +0000 (20:26 -0500)
When we receive a new genid from a neighbor, we need
to form the neigbhor relationship before the join/prune
messages are sent to the neighbor.

Additionally we were calling the
pim_upstream_rpf_genid_changed function 2 times
in a row.  This function just spun throught the upstream
list and marked all relevant upstreams to be sent
immediately

Ticket:CM-11979
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_hello.c
pimd/pim_neighbor.c
pimd/pim_neighbor.h

index 3502f4e962bff880b7c040327b716329372c4755..434a0e66c4da3b602f17f55176558e8981b3a607 100644 (file)
@@ -350,7 +350,8 @@ int pim_hello_recv(struct interface *ifp,
                             hello_option_override_interval,
                             hello_option_dr_priority,
                             hello_option_generation_id,
-                            hello_option_addr_list);
+                            hello_option_addr_list,
+                            PIM_NEIGHBOR_SEND_DELAY);
     if (!neigh) {
       if (PIM_DEBUG_PIM_HELLO) {
        char src_str[100];
@@ -374,11 +375,6 @@ int pim_hello_recv(struct interface *ifp,
     /* GenID mismatch ? */
     if (!PIM_OPTION_IS_SET(neigh->hello_options, PIM_OPTION_MASK_GENERATION_ID) ||
        (hello_option_generation_id != neigh->generation_id)) {
-
-      /* GenID changed */
-
-      pim_upstream_rpf_genid_changed(neigh->source_addr);
-
       /* GenID mismatch, then replace neighbor */
       
       if (PIM_DEBUG_PIM_HELLO) {
@@ -401,7 +397,8 @@ int pim_hello_recv(struct interface *ifp,
                               hello_option_override_interval,
                               hello_option_dr_priority,
                               hello_option_generation_id,
-                              hello_option_addr_list);
+                              hello_option_addr_list,
+                              PIM_NEIGHBOR_SEND_NOW);
       if (!neigh) {
        if (PIM_DEBUG_PIM_HELLO) {
          char src_str[100];
index 2703b8fcf5582d095aff89fe78fe5227391f0fb4..4d793880923efbcf39b4b4e3f330992c79e84f7a 100644 (file)
@@ -411,7 +411,8 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
                                      uint16_t override_interval,
                                      uint32_t dr_priority,
                                      uint32_t generation_id,
-                                     struct list *addr_list)
+                                     struct list *addr_list,
+                                     int send_hello_now)
 {
   struct pim_interface *pim_ifp;
   struct pim_neighbor *neigh;
@@ -450,8 +451,16 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
     message with a new GenID is received from an existing neighbor, a
     new Hello message should be sent on this interface after a
     randomized delay between 0 and Triggered_Hello_Delay.
+
+    This is a bit silly to do it that way.  If I get a new
+    genid we need to send the hello *now* because we've
+    lined up a bunch of join/prune messages to go out the
+    interface.
   */
-  pim_hello_restart_triggered(neigh->interface);
+  if (send_hello_now)
+    pim_hello_restart_now (ifp);
+  else
+    pim_hello_restart_triggered(neigh->interface);
 
   return neigh;
 }
index 10d0cf3a68382e343963dde580c3d00da61a85a7..4bf78d063ea8e3c2944b3fa66ab8dddc6fccf5c0 100644 (file)
@@ -47,6 +47,10 @@ void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime);
 void pim_neighbor_free(struct pim_neighbor *neigh);
 struct pim_neighbor *pim_neighbor_find(struct interface *ifp,
                                       struct in_addr source_addr);
+
+
+#define PIM_NEIGHBOR_SEND_DELAY 0
+#define PIM_NEIGHBOR_SEND_NOW   1
 struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
                                      struct in_addr source_addr,
                                      pim_hello_options hello_options,
@@ -55,7 +59,8 @@ struct pim_neighbor *pim_neighbor_add(struct interface *ifp,
                                      uint16_t override_interval,
                                      uint32_t dr_priority,
                                      uint32_t generation_id,
-                                     struct list *addr_list);
+                                     struct list *addr_list,
+                                     int send_hello_now);
 void pim_neighbor_delete(struct interface *ifp,
                         struct pim_neighbor *neigh,
                         const char *delete_message);