summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-01-09 01:11:17 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-01-12 15:22:46 +0100
commitcbb0dbf6bd49df140ae838b8013c15513d976b4d (patch)
tree6f9969ebf86ba08fea1e0139936c7e1a5384114e /zebra
parentzebra: Add zebra_static_route_leak function (diff)
downloadfrr-cbb0dbf6bd49df140ae838b8013c15513d976b4d.tar.xz
frr-cbb0dbf6bd49df140ae838b8013c15513d976b4d.zip
zebra: Add the zvrf pointer to the 'struct static_route'
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_static.c7
-rw-r--r--zebra/zebra_static.h2
-rw-r--r--zebra/zebra_vty.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c
index 7fdc4908b..3423518bb 100644
--- a/zebra/zebra_static.c
+++ b/zebra/zebra_static.c
@@ -155,7 +155,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
re->metric = 0;
re->mtu = 0;
re->vrf_id = si->vrf_id;
- re->nh_vrf_id = si->vrf_id;
+ re->nh_vrf_id = si->nh_vrf_id;
re->table =
si->vrf_id
? (zebra_vrf_lookup_by_id(si->vrf_id))->table_id
@@ -379,6 +379,7 @@ int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
struct prefix_ipv6 *src_p, union g_addr *gate,
const char *ifname, enum static_blackhole_type bh_type,
route_tag_t tag, u_char distance, struct zebra_vrf *zvrf,
+ struct zebra_vrf *nh_zvrf,
struct static_nh_label *snh_label)
{
struct route_node *rn;
@@ -440,6 +441,8 @@ int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
si->bh_type = bh_type;
si->tag = tag;
si->vrf_id = zvrf_id(zvrf);
+ si->nh_vrf_id = zvrf_id(nh_zvrf);
+
if (ifname)
strlcpy(si->ifname, ifname, sizeof(si->ifname));
si->ifindex = IFINDEX_INTERNAL;
@@ -494,7 +497,7 @@ int static_add_route(afi_t afi, safi_t safi, u_char type, struct prefix *p,
else {
struct interface *ifp;
- ifp = if_lookup_by_name(ifname, zvrf_id(zvrf));
+ ifp = if_lookup_by_name(ifname, zvrf_id(nh_zvrf));
if (ifp && ifp->ifindex != IFINDEX_INTERNAL) {
si->ifindex = ifp->ifindex;
static_install_route(afi, safi, p, src_p, si);
diff --git a/zebra/zebra_static.h b/zebra/zebra_static.h
index 68fe73b0a..234e3e403 100644
--- a/zebra/zebra_static.h
+++ b/zebra/zebra_static.h
@@ -54,6 +54,7 @@ struct static_route {
/* VRF identifier. */
vrf_id_t vrf_id;
+ vrf_id_t nh_vrf_id;
/* Administrative distance. */
u_char distance;
@@ -89,6 +90,7 @@ extern int static_add_route(afi_t, safi_t safi, u_char type, struct prefix *p,
const char *ifname,
enum static_blackhole_type bh_type, route_tag_t tag,
u_char distance, struct zebra_vrf *zvrf,
+ struct zebra_vrf *nh_zvrf,
struct static_nh_label *snh_label);
extern int static_delete_route(afi_t, safi_t safi, u_char type,
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 45e204dcc..ece4428c4 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -233,7 +233,8 @@ static int zebra_static_route_leak(struct vty *vty,
if (!negate)
static_add_route(afi, safi, type, &p, src_p, gatep, ifname,
- bh_type, tag, distance, zvrf, &snh_label);
+ bh_type, tag, distance, zvrf, nh_zvrf,
+ &snh_label);
else
static_delete_route(afi, safi, type, &p, src_p, gatep, ifname,
tag, distance, zvrf, &snh_label);