]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_hello.c
Merge pull request #5494 from opensourcerouting/mlag-module
[mirror_frr.git] / pimd / pim_hello.c
index b6c5bc432d766bf2c275d1a7fd8fac15cbbb3da8..34c5eb43bc0ab338ec2233025851fc1ca7608a90 100644 (file)
@@ -31,6 +31,7 @@
 #include "pim_iface.h"
 #include "pim_neighbor.h"
 #include "pim_upstream.h"
+#include "pim_bsm.h"
 
 static void on_trace(const char *label, struct interface *ifp,
                     struct in_addr src)
@@ -103,7 +104,7 @@ static void tlv_trace(const char *label, const char *tlv_name,
     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, 
+              label,
               src_str, ifname,
               tlv_name);
   }
@@ -127,7 +128,7 @@ static void tlv_trace_list(const char *label, const char *tlv_name,
 
 #define FREE_ADDR_LIST                                                         \
        if (hello_option_addr_list) {                                          \
-               list_delete_and_null(&hello_option_addr_list);                 \
+               list_delete(&hello_option_addr_list);                          \
        }
 
 #define FREE_ADDR_LIST_THEN_RETURN(code)                                       \
@@ -367,6 +368,12 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,
                        }
                        FREE_ADDR_LIST_THEN_RETURN(-8);
                }
+               /* Forward BSM if required */
+               if (!pim_bsm_new_nbr_fwd(neigh, ifp)) {
+                       if (PIM_DEBUG_PIM_HELLO)
+                               zlog_debug("%s: forwarding bsm to new nbr failed",
+                                          __PRETTY_FUNCTION__);
+               }
 
                /* actual addr list has been saved under neighbor */
                return 0;
@@ -420,6 +427,12 @@ int pim_hello_recv(struct interface *ifp, struct in_addr src_addr,
                                }
                                FREE_ADDR_LIST_THEN_RETURN(-9);
                        }
+                       /* Forward BSM if required */
+                       if (!pim_bsm_new_nbr_fwd(neigh, ifp)) {
+                               if (PIM_DEBUG_PIM_HELLO)
+                                       zlog_debug("%s: forwarding bsm to new nbr failed",
+                                                  __PRETTY_FUNCTION__);
+                       }
                        /* actual addr list is saved under neighbor */
                        return 0;