diff --git a/src/sonic-frr/patch/0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch b/src/sonic-frr/patch/0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch new file mode 100644 index 000000000000..834ef899e72f --- /dev/null +++ b/src/sonic-frr/patch/0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch @@ -0,0 +1,30 @@ +From 4aa1aace3e32039b668c04cd682b01e0397144ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E6=81=AD=E7=AE=80?= +Date: Wed, 26 Jul 2023 09:51:51 +0800 +Subject: [PATCH] zebra: remove duplicated nexthops when sending fpm msg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When zebra send msg to fpm client, it doesn't handle duplicated nexthops especially, which means if zebra has a route with NUM1 recursive nexthops, each resolved to the same NUM2 connected nexthops, it will send to fpm client a route with NUM1*NUM2 nexthops. But actually there are only NUM2 useful nexthops, the left NUM1*NUM2-NUM2 nexthops are all duplicated nexthops. By the way, zebra has duplicated nexthop remove logic when sending msg to kernel. +Add duplicated nexthop remove logic to zebra when sending msg to fpm client. + +Signed-off-by: 恭简 + +--- + zebra/zebra_fpm_netlink.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c +index 06c45578a..231047143 100644 +--- a/zebra/zebra_fpm_netlink.c ++++ b/zebra/zebra_fpm_netlink.c +@@ -305,6 +305,8 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd, + + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE)) + continue; ++ if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE)) ++ continue; + + if (nexthop->type == NEXTHOP_TYPE_BLACKHOLE) { + switch (nexthop->bh_type) { diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index a0cdde792fac..3109ac980549 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -20,3 +20,4 @@ cross-compile-changes.patch 0018-zebra-Use-zebra-dplane-for-RTM-link-and-addr.patch 0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch 0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch +0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch