]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_bfd.c
Merge pull request #2133 from Fredi-raspall/fix_label_manager
[mirror_frr.git] / pimd / pim_bfd.c
index 1dfb558f46de2bd27835dc0b64bc28834a002e99..f5772174baed91baa40f2a083ae3c9c9b0b5bdb3 100644 (file)
@@ -62,7 +62,7 @@ void pim_bfd_write_config(struct vty *vty, struct interface *ifp)
  * pim_bfd_show_info - Show BFD info structure
  */
 void pim_bfd_show_info(struct vty *vty, void *bfd_info, json_object *json_obj,
-                      u_char use_json, int param_only)
+                      uint8_t use_json, int param_only)
 {
        if (param_only)
                bfd_show_param(vty, (struct bfd_info *)bfd_info, 1, 0, use_json,
@@ -179,8 +179,8 @@ void pim_bfd_trigger_event(struct pim_interface *pim_ifp,
  * pim_bfd_if_param_set - Set the configured BFD paramter values for
  *                         interface.
  */
-void pim_bfd_if_param_set(struct interface *ifp, u_int32_t min_rx,
-                         u_int32_t min_tx, u_int8_t detect_mult, int defaults)
+void pim_bfd_if_param_set(struct interface *ifp, uint32_t min_rx,
+                         uint32_t min_tx, uint8_t detect_mult, int defaults)
 {
        struct pim_interface *pim_ifp = ifp->info;
        int command = 0;
@@ -292,34 +292,42 @@ static int pim_bfd_nbr_replay(int command, struct zclient *zclient,
        struct interface *ifp = NULL;
        struct pim_interface *pim_ifp = NULL;
        struct pim_neighbor *neigh = NULL;
-       struct listnode *node;
        struct listnode *neigh_node;
        struct listnode *neigh_nextnode;
+       struct vrf *vrf = NULL;
 
        /* Send the client registration */
        bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
 
-       for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
-               pim_ifp = ifp->info;
+       RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
+               FOR_ALL_INTERFACES (vrf, ifp) {
+                       pim_ifp = ifp->info;
 
-               if (!pim_ifp)
-                       continue;
-
-               if (pim_ifp->pim_sock_fd < 0)
-                       continue;
+                       if (!pim_ifp)
+                               continue;
 
-               for (ALL_LIST_ELEMENTS(pim_ifp->pim_neighbor_list, neigh_node,
-                                      neigh_nextnode, neigh)) {
-                       if (!neigh->bfd_info)
+                       if (pim_ifp->pim_sock_fd < 0)
                                continue;
-                       if (PIM_DEBUG_PIM_TRACE) {
-                               char str[INET_ADDRSTRLEN];
-                               pim_inet4_dump("<bfd_nbr?>", neigh->source_addr,
-                                              str, sizeof(str));
-                               zlog_debug("%s: Replaying Pim Neigh %s to BFD",
-                                          __PRETTY_FUNCTION__, str);
+
+                       for (ALL_LIST_ELEMENTS(pim_ifp->pim_neighbor_list,
+                                              neigh_node, neigh_nextnode,
+                                              neigh)) {
+                               if (!neigh->bfd_info)
+                                       continue;
+                               if (PIM_DEBUG_PIM_TRACE) {
+                                       char str[INET_ADDRSTRLEN];
+
+                                       pim_inet4_dump("<bfd_nbr?>",
+                                                      neigh->source_addr, str,
+                                                      sizeof(str));
+                                       zlog_debug(
+                                               "%s: Replaying Pim Neigh %s to BFD vrf_id %u",
+                                               __PRETTY_FUNCTION__, str,
+                                               vrf->vrf_id);
+                               }
+                               pim_bfd_reg_dereg_nbr(neigh,
+                                                     ZEBRA_BFD_DEST_UPDATE);
                        }
-                       pim_bfd_reg_dereg_nbr(neigh, ZEBRA_BFD_DEST_UPDATE);
                }
        }
        return 0;