summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <Jafaral@users.noreply.github.com>2017-06-07 13:29:56 -0500
committerGitHub <noreply@github.com>2017-06-07 13:29:56 -0500
commit9d693a54fa47a3a46cb672a0a89dc28e10d9498f (patch)
tree2e632bd9593e6cb114e4a03e0a76644fcc0c00f7
parent326452238a0f2610b778678fd639730c7bdd40fb (diff)
parentf6a1dd837bbdd89d9c588731035d805a0b1be5b7 (diff)
Merge pull request #678 from chiragshah6/pim_dev
pimd: fix pim bfd crash and bfd down check specific neigh addr
-rw-r--r--pimd/pim_bfd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c
index b0915fa628..938e35e81a 100644
--- a/pimd/pim_bfd.c
+++ b/pimd/pim_bfd.c
@@ -44,6 +44,9 @@ pim_bfd_write_config (struct vty *vty, struct interface *ifp)
struct pim_interface *pim_ifp = ifp->info;
struct bfd_info *bfd_info = NULL;
+ if (!pim_ifp)
+ return;
+
bfd_info = (struct bfd_info *) pim_ifp->bfd_info;
if (!bfd_info)
return;
@@ -194,6 +197,8 @@ pim_bfd_if_param_set (struct interface *ifp, u_int32_t min_rx,
struct pim_interface *pim_ifp = ifp->info;
int command = 0;
+ if (!pim_ifp)
+ return;
bfd_set_param ((struct bfd_info **) &(pim_ifp->bfd_info), min_rx, min_tx,
detect_mult, defaults, &command);
@@ -259,6 +264,10 @@ pim_bfd_interface_dest_update (int command, struct zclient *zclient,
for (ALL_LIST_ELEMENTS (pim_ifp->pim_neighbor_list, neigh_node,
neigh_nextnode, neigh))
{
+ /* Check neigh address matches with BFD address */
+ if (neigh->source_addr.s_addr != p.u.prefix4.s_addr)
+ continue;
+
bfd_info = (struct bfd_info *) neigh->bfd_info;
if (bfd_info->status == status)
{