summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-04-11 12:00:51 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 11:13:39 -0400
commitbbb3940ed11d62df8263bb97ef393c1d7de0220b (patch)
treed09786a0f3e860c34f8d3901756c31ac284cb478
parentcb50cbc96ee0b6c69e7c80d00c3d26070f4a1651 (diff)
zebra: VRF ID should be null if a nexthop group
A nexthop group should not have a VRF ID. Only individual nexthops need to be using a VRF. Fixed this both kernel and proto side. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
-rw-r--r--zebra/rt_netlink.c2
-rw-r--r--zebra/zebra_rib.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index d2d9060b84..db8e28cea0 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -2298,7 +2298,7 @@ int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
uint32_t id;
unsigned char family;
afi_t afi = AFI_UNSPEC;
- vrf_id_t vrf_id = VRF_DEFAULT;
+ vrf_id_t vrf_id = 0;
struct interface *ifp = NULL;
struct nhmsg *nhm = NULL;
/* struct for nexthop group abstraction */
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 898076b017..96e5816da3 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2641,6 +2641,8 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
struct nhg_connected_head nhg_depends = {0};
/* Default to route afi */
afi_t nhg_afi = afi;
+ /* Default to route vrf id */
+ vrf_id_t nhg_vrf_id = re->vrf_id;
int ret = 0;
if (!re)
@@ -2680,10 +2682,11 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,
/* change the afi for group */
nhg_afi = AFI_UNSPEC;
+ nhg_vrf_id = 0;
}
// TODO: Add proto type here
- nhe = zebra_nhg_find(re->ng, re->vrf_id, nhg_afi, re->nhe_id,
+ nhe = zebra_nhg_find(re->ng, nhg_vrf_id, nhg_afi, re->nhe_id,
&nhg_depends, false);
if (nhe) {