]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Send v6 secondary addresses to neighbors in hello
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 30 Mar 2017 13:01:09 +0000 (09:01 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 30 Mar 2017 13:34:03 +0000 (09:34 -0400)
Send v6 secondary addresses to our neighbor in hello's.

Additionally allow the disabling it via the cli introduced
earlier.

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

index d9b04ea9526fb7eab0cead5d6a79ac4a44edcdd8..ee9433d7973b63e1be15d869f18397a6540dc04e 100644 (file)
@@ -428,15 +428,14 @@ int pim_hello_recv(struct interface *ifp,
   return 0;
 }
 
-int pim_hello_build_tlv(const char *ifname,
+int pim_hello_build_tlv(struct interface *ifp,
                        uint8_t *tlv_buf, int tlv_buf_size,
                        uint16_t holdtime,
                        uint32_t dr_priority,
                        uint32_t generation_id,
                        uint16_t propagation_delay,
                        uint16_t override_interval,
-                       int can_disable_join_suppression,
-                       struct list *ifconnected)
+                       int can_disable_join_suppression)
 {
   uint8_t *curr = tlv_buf;
   uint8_t *pastend = tlv_buf + tlv_buf_size;
@@ -454,7 +453,7 @@ int pim_hello_build_tlv(const char *ifname,
   if (!curr) {
     if (PIM_DEBUG_PIM_HELLO) {
       zlog_debug("%s: could not set PIM hello Holdtime option for interface %s",
-                __PRETTY_FUNCTION__, ifname);
+                __PRETTY_FUNCTION__, ifp->name);
     }
     return -1;
   }
@@ -468,7 +467,7 @@ int pim_hello_build_tlv(const char *ifname,
   if (!tmp) {
     if (PIM_DEBUG_PIM_HELLO) {
       zlog_debug("%s: could not set PIM LAN Prune Delay option for interface %s",
-                __PRETTY_FUNCTION__, ifname);
+                __PRETTY_FUNCTION__, ifp->name);
     }
     return -1;
   }
@@ -485,7 +484,7 @@ int pim_hello_build_tlv(const char *ifname,
   if (!curr) {
     if (PIM_DEBUG_PIM_HELLO) {
       zlog_debug("%s: could not set PIM hello DR Priority option for interface %s",
-                __PRETTY_FUNCTION__, ifname);
+                __PRETTY_FUNCTION__, ifp->name);
     }
     return -2;
   }
@@ -498,24 +497,38 @@ int pim_hello_build_tlv(const char *ifname,
   if (!curr) {
     if (PIM_DEBUG_PIM_HELLO) {
       zlog_debug("%s: could not set PIM hello Generation ID option for interface %s",
-                __PRETTY_FUNCTION__, ifname);
+                __PRETTY_FUNCTION__, ifp->name);
     }
     return -3;
   }
 
   /* Secondary Address List */
-  if (ifconnected) {
+  if (ifp->connected->count) {
     curr = pim_tlv_append_addrlist_ucast(curr,
                                         pastend,
-                                        ifconnected,
+                                        ifp->connected,
                                          AF_INET);
     if (!curr) {
       if (PIM_DEBUG_PIM_HELLO) {
-       zlog_debug("%s: could not set PIM hello Secondary Address List option for interface %s",
-                 __PRETTY_FUNCTION__, ifname);
+       zlog_debug("%s: could not set PIM hello v4 Secondary Address List option for interface %s",
+                 __PRETTY_FUNCTION__, ifp->name);
       }
       return -4;
     }
+    if (pimg->send_v6_secondary)
+      {
+        curr = pim_tlv_append_addrlist_ucast(curr,
+                                             pastend,
+                                             ifp->connected,
+                                             AF_INET6);
+        if (!curr) {
+          if (PIM_DEBUG_PIM_HELLO) {
+            zlog_debug("%s: could not sent PIM hello v6 secondary Address List option for interface %s",
+                       __PRETTY_FUNCTION__, ifp->name);
+          }
+          return -4;
+        }
+      }
   }
 
   return curr - tlv_buf;
index 3a6d3361ba3b877de661a33744aa199feed9e88c..de5359e2c058c403fb5d29ebc47cd4e54c44a701 100644 (file)
@@ -29,15 +29,14 @@ int pim_hello_recv(struct interface *ifp,
                   struct in_addr src_addr,
                   uint8_t *tlv_buf, int tlv_buf_size);
 
-int pim_hello_build_tlv(const char *ifname,
+int pim_hello_build_tlv(struct interface *ifname,
                        uint8_t *tlv_buf, int tlv_buf_size,
                        uint16_t holdtime,
                        uint32_t dr_priority,
                        uint32_t generation_id,
                        uint16_t propagation_delay,
                        uint16_t override_interval,
-                       int can_disable_join_suppression,
-                       struct list *ifconnected);
+                       int can_disable_join_suppression);
 
 void pim_hello_require(struct interface *ifp);
 
index f82687245d77364dec15ca7998e9bae202a3c02f..bc13e10a6117b9cced98c394acafe9e0b0b0fbe3 100644 (file)
@@ -629,7 +629,7 @@ static int hello_send(struct interface *ifp,
               listcount(ifp->connected));
   }
 
-  pim_tlv_size = pim_hello_build_tlv(ifp->name,
+  pim_tlv_size = pim_hello_build_tlv(ifp,
                                     pim_msg + PIM_PIM_MIN_LEN,
                                     sizeof(pim_msg) - PIM_PIM_MIN_LEN,
                                     holdtime,
@@ -637,8 +637,7 @@ static int hello_send(struct interface *ifp,
                                     pim_ifp->pim_generation_id,
                                     pim_ifp->pim_propagation_delay_msec,
                                     pim_ifp->pim_override_interval_msec,
-                                    PIM_IF_TEST_PIM_CAN_DISABLE_JOIN_SUPRESSION(pim_ifp->options),
-                                    ifp->connected);
+                                    PIM_IF_TEST_PIM_CAN_DISABLE_JOIN_SUPRESSION(pim_ifp->options));
   if (pim_tlv_size < 0) {
     return -1;
   }