X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ospfd%2Fospf_bfd.c;h=b9e78f4cd35df77753c6310299e5fde75a057fba;hb=6e641a8f2ea8cef24b0fc02f507e4da5f49ac1e7;hp=c8ad6d04f49ec6de3352bffe4ffccd5f314e9143;hpb=1b072ce466de85e7b028071a869997ca66259157;p=mirror_frr.git diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c index c8ad6d04f..b9e78f4cd 100644 --- a/ospfd/ospf_bfd.c +++ b/ospfd/ospf_bfd.c @@ -65,6 +65,7 @@ static void ospf_bfd_reg_dereg_nbr(struct ospf_neighbor *nbr, int command) struct interface *ifp = oi->ifp; struct ospf_if_params *params; struct bfd_info *bfd_info; + int cbit; /* Check if BFD is enabled */ params = IF_DEF_PARAMS(ifp); @@ -80,8 +81,10 @@ static void ospf_bfd_reg_dereg_nbr(struct ospf_neighbor *nbr, int command) inet_ntoa(nbr->src), ospf_vrf_id_to_name(oi->ospf->vrf_id)); + cbit = CHECK_FLAG(bfd_info->flags, BFD_FLAG_BFD_CBIT_ON); + bfd_peer_sendmsg(zclient, bfd_info, AF_INET, &nbr->src, NULL, ifp->name, - 0, 0, command, 0, oi->ospf->vrf_id); + 0, 0, cbit, command, 0, oi->ospf->vrf_id); } /* @@ -199,15 +202,17 @@ 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; struct bfd_info *bfd_info; struct timeval tv; - ifp = bfd_get_peer_info(zclient->ibuf, &p, NULL, &status, vrf_id); + ifp = bfd_get_peer_info(zclient->ibuf, &p, NULL, &status, + NULL, vrf_id); if ((ifp == NULL) || (p.family != AF_INET)) return 0; @@ -227,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; @@ -236,7 +262,7 @@ static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS) continue; old_status = bfd_info->status; - bfd_info->status = status; + BFD_SET_CLIENT_STATUS(bfd_info->status, status); monotime(&tv); bfd_info->last_update = tv.tv_sec;