]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: pre-fix coccinelle hang points
authorDavid Lamparter <equinox@diac24.net>
Fri, 27 Mar 2020 13:29:51 +0000 (14:29 +0100)
committerDavid Lamparter <equinox@diac24.net>
Tue, 14 Jul 2020 09:27:41 +0000 (11:27 +0200)
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd/bgp_route.c
bgpd/bgp_vty.c

index 19e398fc88a48b4ced70290c5e7ce26c0baa6aa9..966d9a338559222c173f7d3d35cfea7b95392e95 100644 (file)
@@ -3797,13 +3797,9 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
                                                       BGP_PATH_VALID);
                        else {
                                if (BGP_DEBUG(nht, NHT)) {
-                                       char buf1[INET6_ADDRSTRLEN];
-                                       inet_ntop(AF_INET,
-                                                 (const void *)&attr_new
-                                                         ->nexthop,
-                                                 buf1, INET6_ADDRSTRLEN);
-                                       zlog_debug("%s(%s): NH unresolved",
-                                                  __func__, buf1);
+                                       zlog_debug("%s(%pI4): NH unresolved",
+                                                  __func__,
+                                                  (in_addr_t *)&attr_new->nexthop);
                                }
                                bgp_path_info_unset_flag(dest, pi,
                                                         BGP_PATH_VALID);
@@ -9598,7 +9594,6 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
        unsigned long output_count = 0;
        unsigned long total_count = 0;
        struct prefix *p;
-       char buf2[BUFSIZ];
        json_object *json_paths = NULL;
        int first = 1;
 
@@ -9863,11 +9858,10 @@ static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
                                                dest_p->u.prefix_flowspec
                                                        .prefixlen);
                        } else {
-                               prefix2str(dest_p, buf2, sizeof(buf2));
                                if (first)
-                                       vty_out(vty, "\"%s\": ", buf2);
+                                       vty_out(vty, "\"%pFX\": ", dest_p);
                                else
-                                       vty_out(vty, ",\"%s\": ", buf2);
+                                       vty_out(vty, ",\"%pFX\": ", dest_p);
                        }
                        vty_out(vty, "%s",
                                json_object_to_json_string_ext(
index fe52b73438a1844d2e43fb17cc4202f258dd6693..6774040c4c86f9fe79a2d19c3c08c4ad4c3f4503 100644 (file)
@@ -10884,10 +10884,9 @@ static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
                                        p->group, &prefix);
 
                                if (range) {
-                                       prefix2str(range, buf1, sizeof(buf1));
                                        vty_out(vty,
-                                               " Belongs to the subnet range group: %s\n",
-                                               buf1);
+                                               " Belongs to the subnet range group: %pFX\n",
+                                               range);
                                }
                        }
                }