Merge pull request #972 from chiragshah6/mdev

Pim Bfd related changes
This commit is contained in:
David Lamparter 2017-08-16 19:14:08 +02:00 committed by GitHub
commit ad5c17afcd
2 changed files with 45 additions and 22 deletions

View File

@ -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;
for (ALL_LIST_ELEMENTS(pim_ifp->pim_neighbor_list, neigh_node,
neigh_nextnode, neigh)) {
if (!neigh->bfd_info)
if (!pim_ifp)
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);
if (pim_ifp->pim_sock_fd < 0)
continue;
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;

View File

@ -7328,8 +7328,14 @@ DEFUN (ip_pim_bfd,
struct pim_interface *pim_ifp = ifp->info;
struct bfd_info *bfd_info = NULL;
if (!pim_ifp)
return CMD_SUCCESS;
if (!pim_ifp) {
if (!pim_cmd_interface_add(ifp)) {
vty_out(vty, "Could not enable PIM SM on interface\n");
return CMD_WARNING;
}
}
pim_ifp = ifp->info;
bfd_info = pim_ifp->bfd_info;
if (!bfd_info || !CHECK_FLAG(bfd_info->flags, BFD_FLAG_PARAM_CFG))
@ -7350,8 +7356,10 @@ DEFUN (no_ip_pim_bfd,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp = ifp->info;
if (!pim_ifp)
return CMD_SUCCESS;
if (!pim_ifp) {
vty_out(vty, "Pim not enabled on this interface\n");
return CMD_WARNING;
}
if (pim_ifp->bfd_info) {
pim_bfd_reg_dereg_all_nbr(ifp, ZEBRA_BFD_DEST_DEREGISTER);
@ -7379,7 +7387,14 @@ DEFUN (ip_pim_bfd_param,
u_int32_t tx_val;
u_int8_t dm_val;
int ret;
struct pim_interface *pim_ifp = ifp->info;
if (!pim_ifp) {
if (!pim_cmd_interface_add(ifp)) {
vty_out(vty, "Could not enable PIM SM on interface\n");
return CMD_WARNING;
}
}
if ((ret = bfd_validate_param(
vty, argv[idx_number]->arg, argv[idx_number_2]->arg,