You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.2 KiB

  1. From eb3e472904e30f35825f08319608217082d4af21 Mon Sep 17 00:00:00 2001
  2. From: Radhika Mahankali <radhika@cumulusnetworks.com>
  3. Date: Mon, 9 Apr 2018 15:30:32 -0700
  4. Subject: [PATCH] ospf: BFD down not tearing down OSPF adjacency for
  5. point-to-point network
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Root Cause:
  10. Lookup for the point-to-point neighbor was failing because the neighbor
  11. lookup was based on neighbor interface IP address. But, for point-to-point
  12. neighbor the key is router-id for lookup. Lookup failure was causing the
  13. BFD updates from PTM to get dropped.
  14. Fix:
  15. Added walk of the neighbor list if the network type is point-to-point to
  16. find the appropriate neighbor. The match is based on source IP address of
  17. the neighbor since that’s the address registered with BFD for monitoring.
  18. Ticket: CM-20411
  19. Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
  20. ---
  21. ospfd/ospf_bfd.c | 26 ++++++++++++++++++++++++--
  22. 1 file changed, 24 insertions(+), 2 deletions(-)
  23. diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c
  24. index a17975270a..05ec4991e5 100644
  25. --- a/ospfd/ospf_bfd.c
  26. +++ b/ospfd/ospf_bfd.c
  27. @@ -202,8 +202,9 @@ static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
  28. struct interface *ifp;
  29. struct ospf_interface *oi;
  30. struct ospf_if_params *params;
  31. - struct ospf_neighbor *nbr;
  32. + struct ospf_neighbor *nbr = NULL;
  33. struct route_node *node;
  34. + struct route_node *n_node;
  35. struct prefix p;
  36. int status;
  37. int old_status;
  38. @@ -231,7 +232,28 @@ static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
  39. if ((oi = node->info) == NULL)
  40. continue;
  41. - nbr = ospf_nbr_lookup_by_addr(oi->nbrs, &p.u.prefix4);
  42. + /* walk the neighbor list for point-to-point network */
  43. + if (oi->type == OSPF_IFTYPE_POINTOPOINT) {
  44. + for (n_node = route_top(oi->nbrs); n_node;
  45. + n_node = route_next(n_node)) {
  46. + nbr = n_node->info;
  47. + if (nbr) {
  48. + /* skip myself */
  49. + if (nbr == oi->nbr_self) {
  50. + nbr = NULL;
  51. + continue;
  52. + }
  53. +
  54. + /* Found the matching neighbor */
  55. + if (nbr->src.s_addr ==
  56. + p.u.prefix4.s_addr)
  57. + break;
  58. + }
  59. + }
  60. + } else {
  61. + nbr = ospf_nbr_lookup_by_addr(oi->nbrs, &p.u.prefix4);
  62. + }
  63. +
  64. if (!nbr || !nbr->bfd_info)
  65. continue;