summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorYutaro Hayakawa <yutaro.hayakawa@isovalent.com>2022-12-25 14:52:57 +0900
committerYutaro Hayakawa <yutaro.hayakawa@isovalent.com>2022-12-25 14:52:57 +0900
commit45c129948cc3820a49cade81aba1c433507d47df (patch)
tree0e7f44a0f8d0d8fcd58e750b8647e90da3c4c6c7 /zebra/rt_netlink.c
parent9a7f2c220346abba8a74eaf686d29f620b2c8000 (diff)
fpm: Send NH message to FPM even if the local kernel doesn't support it
netlink_route_multipath_msg_encode checks whether the local kernel supports NextHop Netlink message and doesn't send the message if the local kernel doesn't have support. This is also applied to the FPM since kernel dataplane and FPM shares the same code. However, for the FPM, it's not necessary to have this limit. This commit adds extra check if netlink_route_multipath_msg_encode is called from the FPM and bypass kernel support check if it is from the FPM. Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c9
1 files changed, 5 insertions, 4 deletions
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