]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd, lib, ospfd, ospf6d: Fix bfd interface lookup
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 24 Mar 2016 13:03:02 +0000 (06:03 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 24 Mar 2016 13:03:02 +0000 (06:03 -0700)
bfd was receiving a callback with an interface name string
but was ignoring the passed in vrf to find the ifp pointer.
This commit fixes that code path in bfd.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Radhika Mahankali <radhika@cumulusnetworks.com>
bgpd/bgp_bfd.c
lib/bfd.c
lib/bfd.h
ospf6d/ospf6_bfd.c
ospfd/ospf_bfd.c

index 3f5c4d025782f344524b789ef38d372fec012c32..118d8f64c243637cbf85da3a5081e093e5cf4ee8 100644 (file)
@@ -239,7 +239,7 @@ bgp_bfd_dest_update (int command, struct zclient *zclient,
   struct prefix sp;
   int status;
 
-  ifp = bfd_get_peer_info (zclient->ibuf, &dp, &sp, &status);
+  ifp = bfd_get_peer_info (zclient->ibuf, &dp, &sp, &status, vrf_id);
 
   if (BGP_DEBUG (zebra, ZEBRA))
     {
index e057bb05bf4d4a50dd84d5ecc2fef491cd23a613..4a29b3267dca0fcba9b8f8b7e2c9b708fb382af3 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -253,7 +253,7 @@ bfd_get_command_dbg_str(int command)
  */
 struct interface *
 bfd_get_peer_info (struct stream *s, struct prefix *dp, struct prefix *sp,
-                    int *status)
+                    int *status, vrf_id_t vrf_id)
 {
   unsigned int ifindex;
   struct interface *ifp = NULL;
@@ -265,7 +265,7 @@ bfd_get_peer_info (struct stream *s, struct prefix *dp, struct prefix *sp,
   /* Lookup index. */
   if (ifindex != 0)
     {
-      ifp = if_lookup_by_index (ifindex);
+      ifp = if_lookup_by_index_vrf (ifindex, vrf_id);
       if (ifp == NULL)
         {
           zlog_warn ("zebra_interface_bfd_read: "
index 31eb4ad9a3529855479ca9f4d541ef48afe55412..b001ae9670e30d4b3f34e3cd0db7793982c9388a 100644 (file)
--- a/lib/bfd.h
+++ b/lib/bfd.h
@@ -82,7 +82,7 @@ bfd_get_command_dbg_str(int command);
 
 extern struct interface *
 bfd_get_peer_info (struct stream *s, struct prefix *dp, struct prefix *sp,
-                   int *status);
+                   int *status, vrf_id_t vrf_id);
 
 const char *
 bfd_get_status_str(int status);
index f44dd5c0e6468dbbeea0c7916bf894a3ab4a6589..f14571d1f9a6bb8314858977c5c58f1b974eb23c 100644 (file)
@@ -206,7 +206,7 @@ ospf6_bfd_interface_dest_update (int command, struct zclient *zclient,
   struct bfd_info *bfd_info;
   struct timeval tv;
 
-  ifp = bfd_get_peer_info(zclient->ibuf, &dp, &sp, &status);
+  ifp = bfd_get_peer_info(zclient->ibuf, &dp, &sp, &status, vrf_id);
 
   if ((ifp == NULL) || (dp.family != AF_INET6))
     return 0;
index 1a461e48b601436e83fea5aa5adf62856591ebc6..e9c6bfd8e7e5519aadb0126b918f3feaed301119 100644 (file)
@@ -217,7 +217,7 @@ ospf_bfd_interface_dest_update (int command, struct zclient *zclient,
   struct bfd_info *bfd_info;
   struct timeval tv;
 
-  ifp = bfd_get_peer_info (zclient->ibuf, &p, NULL, &status);
+  ifp = bfd_get_peer_info (zclient->ibuf, &p, NULL, &status, vrf_id);
 
   if ((ifp == NULL) || (p.family != AF_INET))
     return 0;