]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #2103 from donaldsharp/bgp_zebra_youch
authorLou Berger <lberger@labn.net>
Mon, 23 Apr 2018 15:02:15 +0000 (11:02 -0400)
committerGitHub <noreply@github.com>
Mon, 23 Apr 2018 15:02:15 +0000 (11:02 -0400)
bgpd: The deletion of a bgp route does not need to send some data

lib/table.h
lib/thread.c
zebra/redistribute.c

index 9637fec1499ccb2e07a916cbab5e870adeaf0ded..a9d788b35a07d6970554a7e365ac43668afc0e28 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "memory.h"
 #include "hash.h"
+#include "prefix.h"
 DECLARE_MTYPE(ROUTE_TABLE)
 DECLARE_MTYPE(ROUTE_NODE)
 
index f3129e39e83af39fdb5f1ac3b351518b37cdff00..8764c055cb989f226eea765d85f7da29a2f21ffb 100644 (file)
@@ -140,7 +140,7 @@ static void cpu_record_print(struct vty *vty, thread_type filter)
 
                        char underline[strlen(name) + 1];
                        memset(underline, '-', sizeof(underline));
-                       underline[sizeof(underline)] = '\0';
+                       underline[sizeof(underline) - 1] = '\0';
 
                        vty_out(vty, "\n");
                        vty_out(vty, "Showing statistics for pthread %s\n",
index a51cd6ecc94342c5600e12497e4c0b02ddce8f13..1d66653e74580f47c5622a7c39d7f73b21480141 100644 (file)
@@ -113,18 +113,20 @@ static void zebra_redistribute(struct zserv *client, int type,
        for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
                RNODE_FOREACH_RE (rn, newre) {
                        struct prefix *dst_p, *src_p;
+                       char buf[PREFIX_STRLEN];
+
                        srcdest_rnode_prefixes(rn, &dst_p, &src_p);
 
                        if (IS_ZEBRA_DEBUG_EVENT)
                                zlog_debug(
-                                       "%s: client %s vrf %d checking: selected=%d, type=%d, distance=%d, "
-                                       "zebra_check_addr=%d",
+                                       "%s: client %s %s(%d) checking: selected=%d, type=%d, distance=%d, metric=%d zebra_check_addr=%d",
                                        __func__,
                                        zebra_route_string(client->proto),
+                                       prefix2str(dst_p, buf, sizeof(buf)),
                                        vrf_id, CHECK_FLAG(newre->flags,
                                                           ZEBRA_FLAG_SELECTED),
                                        newre->type, newre->distance,
-                                       zebra_check_addr(dst_p));
+                                       newre->metric, zebra_check_addr(dst_p));
 
                        if (!CHECK_FLAG(newre->flags, ZEBRA_FLAG_SELECTED))
                                continue;
@@ -151,13 +153,13 @@ void redistribute_update(struct prefix *p, struct prefix *src_p,
        struct zserv *client;
        int send_redistribute;
        int afi;
-       char buf[INET6_ADDRSTRLEN];
+       char buf[PREFIX_STRLEN];
 
        if (IS_ZEBRA_DEBUG_RIB) {
-               inet_ntop(p->family, &p->u.prefix, buf, INET6_ADDRSTRLEN);
                zlog_debug(
-                       "%u:%s/%d: Redist update re %p (type %d), old %p (type %d)",
-                       re->vrf_id, buf, p->prefixlen, re, re->type, prev_re,
+                       "%u:%s: Redist update re %p (type %d), old %p (type %d)",
+                       re->vrf_id, prefix2str(p, buf, sizeof(buf)),
+                       re, re->type, prev_re,
                        prev_re ? prev_re->type : -1);
        }
 
@@ -187,6 +189,15 @@ void redistribute_update(struct prefix *p, struct prefix *src_p,
                        send_redistribute = 1;
 
                if (send_redistribute) {
+                       if (IS_ZEBRA_DEBUG_EVENT) {
+                               zlog_debug(
+                                          "%s: client %s %s(%d), type=%d, distance=%d, metric=%d",
+                                          __func__,
+                                          zebra_route_string(client->proto),
+                                          prefix2str(p, buf, sizeof(buf)),
+                                          re->vrf_id, re->type,
+                                          re->distance, re->metric);
+                       }
                        zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_ADD,
                                                 client, p, src_p, re);
                } else if (prev_re