summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-05-15 01:42:39 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 17:13:40 +0200
commitde3f54881950c999ba5034bf525783a2c9d8e931 (patch)
tree83350c2c1e5c709e236fd6fd8971fc9ad983bad3 /zebra/rt_netlink.c
parentzebra: Fix nhg ifindex setting and checking (diff)
downloadfrr-de3f54881950c999ba5034bf525783a2c9d8e931.tar.xz
frr-de3f54881950c999ba5034bf525783a2c9d8e931.zip
zebra: Use NHE id on kernel route sends
If the kernel supports nexthop objects, send the route using an nhg_hash_entry ID instead. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 83e3fd558..5d2d40768 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1637,6 +1637,13 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx)
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.
*/