]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_hello.c
Merge pull request #130 from LabNConsulting/working/master/patch/rev-2.1
[mirror_frr.git] / pimd / pim_hello.c
index bfc128b97aa25522e7dae3eac1d2170debb0c674..3d7ae4ad22bdc977bdd2b45848aab3157341b1a3 100644 (file)
   along with this program; see the file COPYING; if not, write to the
   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
   MA 02110-1301 USA
-  
-  $QuaggaId: $Format:%an, %ai, %h$ $
 */
 
 #include <zebra.h>
 
 #include "log.h"
+#include "if.h"
 
 #include "pimd.h"
 #include "pim_pim.h"
@@ -38,7 +37,7 @@ static void on_trace(const char *label,
                     struct interface *ifp, struct in_addr src)
 {
   if (PIM_DEBUG_PIM_TRACE) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src, src_str, sizeof(src_str));
     zlog_debug("%s: from %s on %s",
               label, src_str, ifp->name);
@@ -50,7 +49,7 @@ static void tlv_trace_bool(const char *label, const char *tlv_name,
                           int isset, int value)
 {
   if (isset) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
     zlog_debug("%s: PIM hello option from %s on interface %s: %s=%d",
               label, 
@@ -64,7 +63,7 @@ static void tlv_trace_uint16(const char *label, const char *tlv_name,
                             int isset, uint16_t value)
 {
   if (isset) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
     zlog_debug("%s: PIM hello option from %s on interface %s: %s=%u",
               label, 
@@ -78,7 +77,7 @@ static void tlv_trace_uint32(const char *label, const char *tlv_name,
                             int isset, uint32_t value)
 {
   if (isset) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
     zlog_debug("%s: PIM hello option from %s on interface %s: %s=%u",
               label, 
@@ -92,7 +91,7 @@ static void tlv_trace_uint32_hex(const char *label, const char *tlv_name,
                                 int isset, uint32_t value)
 {
   if (isset) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
     zlog_debug("%s: PIM hello option from %s on interface %s: %s=%08x",
               label, 
@@ -107,7 +106,7 @@ static void tlv_trace(const char *label, const char *tlv_name,
                      int isset)
 {
   if (isset) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
     zlog_debug("%s: PIM hello option from %s on interface %s: %s",
               label, 
@@ -122,7 +121,7 @@ static void tlv_trace_list(const char *label, const char *tlv_name,
                           int isset, struct list *addr_list)
 {
   if (isset) {
-    char src_str[100];
+    char src_str[INET_ADDRSTRLEN];
     pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
     zlog_debug("%s: PIM hello option from %s on interface %s: %s size=%d list=%p",
               label, 
@@ -182,7 +181,7 @@ int pim_hello_recv(struct interface *ifp,
 
     if (remain < PIM_TLV_MIN_SIZE) {
       if (PIM_DEBUG_PIM_HELLO) {
-       char src_str[100];
+       char src_str[INET_ADDRSTRLEN];
        pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
        zlog_debug("%s: short PIM hello TLV size=%d < min=%d from %s on interface %s",
                   __PRETTY_FUNCTION__,
@@ -199,7 +198,7 @@ int pim_hello_recv(struct interface *ifp,
 
     if ((tlv_curr + option_len) > tlv_pastend) {
       if (PIM_DEBUG_PIM_HELLO) {
-       char src_str[100];
+       char src_str[INET_ADDRSTRLEN];
        pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
        zlog_debug("%s: long PIM hello TLV type=%d length=%d > left=%td from %s on interface %s",
                   __PRETTY_FUNCTION__,
@@ -210,7 +209,7 @@ int pim_hello_recv(struct interface *ifp,
     }
 
     if (PIM_DEBUG_PIM_HELLO) {
-      char src_str[100];
+      char src_str[INET_ADDRSTRLEN];
       pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
       zlog_debug("%s: parse left_size=%d: PIM hello TLV type=%d length=%d from %s on %s",
                 __PRETTY_FUNCTION__,
@@ -268,7 +267,7 @@ int pim_hello_recv(struct interface *ifp,
       break;
     case PIM_MSG_OPTION_TYPE_DM_STATE_REFRESH:
       if (PIM_DEBUG_PIM_HELLO) {
-       char src_str[100];
+       char src_str[INET_ADDRSTRLEN];
        pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
        zlog_debug("%s: ignoring PIM hello dense-mode state refresh TLV option type=%d length=%d from %s on interface %s",
                   __PRETTY_FUNCTION__,
@@ -278,7 +277,7 @@ int pim_hello_recv(struct interface *ifp,
       break;
     default:
       if (PIM_DEBUG_PIM_HELLO) {
-       char src_str[100];
+       char src_str[INET_ADDRSTRLEN];
        pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
        zlog_debug("%s: ignoring unknown PIM hello TLV type=%d length=%d from %s on interface %s",
                   __PRETTY_FUNCTION__,
@@ -327,7 +326,7 @@ int pim_hello_recv(struct interface *ifp,
 
   if (!PIM_OPTION_IS_SET(hello_options, PIM_OPTION_MASK_HOLDTIME)) {
     if (PIM_DEBUG_PIM_HELLO) {
-      char src_str[100];
+      char src_str[INET_ADDRSTRLEN];
       pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
       zlog_debug("%s: PIM hello missing holdtime from %s on interface %s",
                __PRETTY_FUNCTION__,
@@ -350,10 +349,11 @@ 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];
+       char src_str[INET_ADDRSTRLEN];
        pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
        zlog_warn("%s: failure creating PIM neighbor %s on interface %s",
                  __PRETTY_FUNCTION__,
@@ -374,15 +374,10 @@ 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) {
-       char src_str[100];
+       char src_str[INET_ADDRSTRLEN];
        pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
        zlog_debug("%s: GenId mismatch new=%08x old=%08x: replacing neighbor %s on %s",
                   __PRETTY_FUNCTION__,
@@ -401,10 +396,11 @@ 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];
+         char src_str[INET_ADDRSTRLEN];
          pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
          zlog_debug("%s: failure re-creating PIM neighbor %s on interface %s",
                     __PRETTY_FUNCTION__,