diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 337113988e..8550d7e304 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -863,7 +863,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx) case DPLANE_OP_NH_DELETE: rv = netlink_nexthop_msg_encode(RTM_DELNEXTHOP, ctx, nl_buf, - sizeof(nl_buf)); + sizeof(nl_buf), true); if (rv <= 0) { zlog_err("%s: netlink_nexthop_msg_encode failed", __func__); @@ -875,7 +875,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx) case DPLANE_OP_NH_INSTALL: case DPLANE_OP_NH_UPDATE: rv = netlink_nexthop_msg_encode(RTM_NEWNEXTHOP, ctx, nl_buf, - sizeof(nl_buf)); + sizeof(nl_buf), true); if (rv <= 0) { zlog_err("%s: netlink_nexthop_msg_encode failed", __func__); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 33fe8db99e..10725665e8 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2501,7 +2501,7 @@ static bool _netlink_nexthop_build_group(struct nlmsghdr *n, size_t req_size, */ ssize_t netlink_nexthop_msg_encode(uint16_t cmd, const struct zebra_dplane_ctx *ctx, - void *buf, size_t buflen) + void *buf, size_t buflen, bool fpm) { struct { struct nlmsghdr n; @@ -2528,9 +2528,10 @@ ssize_t netlink_nexthop_msg_encode(uint16_t cmd, /* * Nothing to do if the kernel doesn't support nexthop objects or - * we dont want to install this type of NHG + * we dont want to install this type of NHG, but FPM may possible to + * handle this. */ - if (!kernel_nexthops_supported()) { + if (!fpm && !kernel_nexthops_supported()) { if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_NHG) zlog_debug( "%s: nhg_id %u (%s): kernel nexthops not supported, ignoring", @@ -2850,7 +2851,7 @@ static ssize_t netlink_nexthop_msg_encoder(struct zebra_dplane_ctx *ctx, return -1; } - return netlink_nexthop_msg_encode(cmd, ctx, buf, buflen); + return netlink_nexthop_msg_encode(cmd, ctx, buf, buflen, false); } enum netlink_msg_status diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h index fd2b79a2bf..b67169d6f0 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h @@ -84,7 +84,7 @@ extern int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id, extern int netlink_nexthop_read(struct zebra_ns *zns); extern ssize_t netlink_nexthop_msg_encode(uint16_t cmd, const struct zebra_dplane_ctx *ctx, - void *buf, size_t buflen); + void *buf, size_t buflen, bool fpm); extern ssize_t netlink_lsp_msg_encoder(struct zebra_dplane_ctx *ctx, void *buf, size_t buflen);