summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-03-24 14:03:02 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-03-24 14:03:02 +0100
commit1e22a2af507e0a51236d250e57145659754f81bb (patch)
tree36ef56cfaa79f375a10a7db7cab83187c867559b
parentbgpd, lib, zebra: Add ability to retrieve ifp without specifying a vrf (diff)
downloadfrr-1e22a2af507e0a51236d250e57145659754f81bb.tar.xz
frr-1e22a2af507e0a51236d250e57145659754f81bb.zip
bgpd, lib, ospfd, ospf6d: Fix bfd interface lookup
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>
-rw-r--r--bgpd/bgp_bfd.c2
-rw-r--r--lib/bfd.c4
-rw-r--r--lib/bfd.h2
-rw-r--r--ospf6d/ospf6_bfd.c2
-rw-r--r--ospfd/ospf_bfd.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c
index 3f5c4d025..118d8f64c 100644
--- a/bgpd/bgp_bfd.c
+++ b/bgpd/bgp_bfd.c
@@ -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))
{
diff --git a/lib/bfd.c b/lib/bfd.c
index e057bb05b..4a29b3267 100644
--- 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: "
diff --git a/lib/bfd.h b/lib/bfd.h
index 31eb4ad9a..b001ae967 100644
--- 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);
diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c
index f44dd5c0e..f14571d1f 100644
--- a/ospf6d/ospf6_bfd.c
+++ b/ospf6d/ospf6_bfd.c
@@ -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;
diff --git a/ospfd/ospf_bfd.c b/ospfd/ospf_bfd.c
index 1a461e48b..e9c6bfd8e 100644
--- a/ospfd/ospf_bfd.c
+++ b/ospfd/ospf_bfd.c
@@ -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;