]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: remove duplicated nexthops when sending fpm msg 14096/head
author恭简 <gongjian.lhr@alibaba-inc.com>
Wed, 26 Jul 2023 01:51:51 +0000 (09:51 +0800)
committer恭简 <gongjian.lhr@alibaba-inc.com>
Tue, 1 Aug 2023 01:58:00 +0000 (09:58 +0800)
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: 恭简 <gongjian.lhr@alibaba-inc.com>
zebra/zebra_fpm_netlink.c

index ba34951e76e7700e93ad3b1bc8e6ae1185803ed3..127976223221c66c59422732274557fb741c5e7a 100644 (file)
@@ -287,6 +287,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) {