]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: bugfix of error quit of zebra, due to no nexthop ACTIVE 9214/head
authorbatmancn <batmanustc@gmail.com>
Mon, 30 Nov 2020 12:04:44 +0000 (20:04 +0800)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 28 Jul 2021 20:13:59 +0000 (16:13 -0400)
There exists some rare situations where fpm will attempt
to send a route update with no valid nexthops.  In that
case an assert would be hit.  This is not good for
trying to keep your routing daemons up and running
when we can safely just recover the situation.

Fixes #7588
Signed-off-by: batmancn <batmanustc@gmail.com>
<fixed commit message, and used zlog_err>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_fpm.c

index 07a82886056b18c443ec5a2f06042f35752dba00..855e19dc453b6b30f93f7caf664cdb322f380da7 100644 (file)
@@ -1002,7 +1002,6 @@ static int zfpm_build_route_updates(void)
                        data_len = zfpm_encode_route(dest, re, (char *)data,
                                                     buf_end - data, &msg_type);
 
-                       assert(data_len);
                        if (data_len) {
                                hdr->msg_type = msg_type;
                                msg_len = fpm_data_len_to_msg_len(data_len);
@@ -1013,6 +1012,9 @@ static int zfpm_build_route_updates(void)
                                        zfpm_g->stats.route_adds++;
                                else
                                        zfpm_g->stats.route_dels++;
+                       } else {
+                               zlog_err("%s: Encoding Prefix: %pRN No valid nexthops",
+                                        __func__, dest->rnode);
                        }
                }