summaryrefslogtreecommitdiff
path: root/pimd/pim_bfd.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-08-13 17:41:01 -0700
committerChirag Shah <chirag@cumulusnetworks.com>2017-08-13 17:41:01 -0700
commitdf83d4e19d5638e3e599412ce7274b8bff57784e (patch)
tree45735c2a64ed666d76daaf57c8c52d6f9caeb6b2 /pimd/pim_bfd.c
parent2fd8de7d965c376dc76cd58b8354412d7a511350 (diff)
pimd: pim bfd vrf aware
BFD replay for all interfaces was only considering VRF_DEFAULT interface list. The change will walk all VRFs, interface list per VRF to register pim neighbor with BFD. Signed-off-by: Chirag shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_bfd.c')
-rw-r--r--pimd/pim_bfd.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c
index 1dfb558f46..bba26662bd 100644
--- a/pimd/pim_bfd.c
+++ b/pimd/pim_bfd.c
@@ -295,31 +295,39 @@ static int pim_bfd_nbr_replay(int command, struct zclient *zclient,
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_LIST_ELEMENTS_RO(vrf_iflist(vrf->vrf_id), node, 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;