]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Convert zserv_nexthop_num_warn to return bool
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 9 Jan 2020 14:01:10 +0000 (09:01 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 28 Sep 2020 16:40:59 +0000 (12:40 -0400)
Allow us to key of the warning if we have one.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zapi_msg.c
zebra/zapi_msg.h

index e436e5a288a0bdd86ff4ce0c0acc3fdd8bbcdd55..6d7e84235412dbaf668f7dbe2df221174e5b7782 100644 (file)
@@ -1411,8 +1411,7 @@ stream_failure:
        return;
 }
 
-
-void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
+bool zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
                            const unsigned int nexthop_num)
 {
        if (nexthop_num > zrouter.multipath_num) {
@@ -1423,7 +1422,10 @@ void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
                        EC_ZEBRA_MORE_NH_THAN_MULTIPATH,
                        "%s: Prefix %s has %d nexthops, but we can only use the first %d",
                        caller, buff, nexthop_num, zrouter.multipath_num);
+               return true;
        }
+
+       return false;
 }
 
 /*
index e7c755c2bf403ccfdd0f86ab573714a711f84565..9f23a313bf2d704b430bc83e70b63b8ace308e3f 100644 (file)
@@ -90,7 +90,7 @@ zsend_ipset_entry_notify_owner(struct zebra_pbr_ipset_entry *ipset,
                               enum zapi_ipset_entry_notify_owner note);
 extern void zsend_iptable_notify_owner(struct zebra_pbr_iptable *iptable,
                                       enum zapi_iptable_notify_owner note);
-extern void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
+extern bool zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
                                   const unsigned int nexthop_num);
 
 extern void zsend_capabilities_all_clients(void);