If the kernel supports nexthop objects, send the route
using an nhg_hash_entry ID instead.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
RTA_PAYLOAD(rta));
}
+ if (dplane_ctx_get_nhe_id(ctx)) {
+ /* Kernel supports nexthop objects */
+ addattr32(&req.n, sizeof(req), RTA_NH_ID,
+ dplane_ctx_get_nhe_id(ctx));
+ goto skip;
+ }
+
/* Count overall nexthops so we can decide whether to use singlepath
* or multipath case.
*/
zns = zvrf->zns;
dplane_ctx_ns_init(ctx, zns, (op == DPLANE_OP_ROUTE_UPDATE));
+ if (re->nhe_id && zns->supports_nh)
+ ctx->u.rinfo.nhe.id = re->nhe_id;
+
/* Trying out the sequence number idea, so we can try to detect
* when a result is stale.
*/