diff options
| author | Rafael Zalamena <rzalamena@users.noreply.github.com> | 2019-11-01 11:22:56 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-01 11:22:56 -0300 |
| commit | 845e689ea03766412f4d25312cefd05e6fdba58a (patch) | |
| tree | d4e44502f0e483d47dd94f6b404c93704933680d | |
| parent | 0106c0236e2018c8e524420058ea4c3e1b6c9ede (diff) | |
| parent | 6e641a8f2ea8cef24b0fc02f507e4da5f49ac1e7 (diff) | |
Merge pull request #5258 from dslicenc/ospf-bfd
ospf: BFD down not tearing down OSPF adjacency for point-to-point net…
| -rw-r--r-- | ospfd/ospf_bfd.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c index 73802ce13e..b9e78f4cd3 100644 --- a/ospfd/ospf_bfd.c +++ b/ospfd/ospf_bfd.c @@ -202,8 +202,9 @@ static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS) struct interface *ifp; struct ospf_interface *oi; struct ospf_if_params *params; - struct ospf_neighbor *nbr; + struct ospf_neighbor *nbr = NULL; struct route_node *node; + struct route_node *n_node; struct prefix p; int status; int old_status; @@ -231,7 +232,28 @@ static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS) if ((oi = node->info) == NULL) continue; - nbr = ospf_nbr_lookup_by_addr(oi->nbrs, &p.u.prefix4); + /* walk the neighbor list for point-to-point network */ + if (oi->type == OSPF_IFTYPE_POINTOPOINT) { + for (n_node = route_top(oi->nbrs); n_node; + n_node = route_next(n_node)) { + nbr = n_node->info; + if (nbr) { + /* skip myself */ + if (nbr == oi->nbr_self) { + nbr = NULL; + continue; + } + + /* Found the matching neighbor */ + if (nbr->src.s_addr == + p.u.prefix4.s_addr) + break; + } + } + } else { + nbr = ospf_nbr_lookup_by_addr(oi->nbrs, &p.u.prefix4); + } + if (!nbr || !nbr->bfd_info) continue; |
