diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-08 09:12:12 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-08 19:35:53 -0500 |
| commit | 4a7371e9e21569eee0e728f64ea06870d1aafa5e (patch) | |
| tree | 15d90068bac9ca5259e6e63b5df7cac7747df08f /lib/zclient.c | |
| parent | a97e5c1a8075fcab9d9e0edb453167752fc3e2b9 (diff) | |
*: Track vrfs per nexthop not per route entry
Track the vfrs on a per nexthop basis instead
of on a per route entry basis.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 0c29b523bf..6882a7ecc5 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -975,12 +975,11 @@ int zapi_route_encode(u_char cmd, struct stream *s, struct zapi_route *api) } stream_putw(s, api->nexthop_num); - if (api->nexthop_num) - stream_putl(s, api->nh_vrf_id); for (i = 0; i < api->nexthop_num; i++) { api_nh = &api->nexthops[i]; + stream_putl(s, api_nh->vrf_id); stream_putc(s, api_nh->type); switch (api_nh->type) { case NEXTHOP_TYPE_BLACKHOLE: @@ -1126,12 +1125,10 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api) return -1; } - if (api->nexthop_num) - STREAM_GETL(s, api->nh_vrf_id); - for (i = 0; i < api->nexthop_num; i++) { api_nh = &api->nexthops[i]; + STREAM_GETL(s, api_nh->vrf_id); STREAM_GETC(s, api_nh->type); switch (api_nh->type) { case NEXTHOP_TYPE_BLACKHOLE: @@ -1217,6 +1214,7 @@ struct nexthop *nexthop_from_zapi_nexthop(struct zapi_nexthop *znh) struct nexthop *n = nexthop_new(); n->type = znh->type; + n->vrf_id = znh->vrf_id; n->ifindex = znh->ifindex; n->gate = znh->gate; |
