]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf: BFD down not tearing down OSPF adjacency for point-to-point network
authorRadhika Mahankali <radhika@cumulusnetworks.com>
Mon, 9 Apr 2018 22:30:32 +0000 (15:30 -0700)
committerDon Slice <dslice@cumulusnetworks.com>
Fri, 1 Nov 2019 14:11:21 +0000 (14:11 +0000)
Root Cause:
Lookup for the point-to-point neighbor was failing because the neighbor
lookup was based on neighbor interface IP address. But, for point-to-point
neighbor the key is router-id for lookup. Lookup failure was causing the
BFD updates from PTM to get dropped.

Fix:
Added walk of the neighbor list if the network type is point-to-point to
find the appropriate neighbor. The match is based on source IP address of
the neighbor since that’s the address registered with BFD for monitoring.

Ticket: CM-20411
Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
ospfd/ospf_bfd.c

index a17975270af957fd8603dad512e163b2b9212de5..05ec4991e507ffa2853a4db0c453dc0a05b57ed4 100644 (file)
@@ -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;