]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_debug.c
bgpd: fix the IGP metric for best path selection on VPN import
[mirror_frr.git] / bgpd / bgp_debug.c
index a629695a3b7c0bf0ef02118aacdc2d7d346539b0..bfde1c127e1ec09aae6d34f74284c20f329b62f1 100644 (file)
@@ -378,8 +378,6 @@ bool bgp_debug_peer_updout_enabled(char *host)
 /* Dump attribute. */
 bool bgp_dump_attr(struct attr *attr, char *buf, size_t size)
 {
-       char addrbuf[BUFSIZ];
-
        if (!attr)
                return false;
 
@@ -395,15 +393,12 @@ bool bgp_dump_attr(struct attr *attr, char *buf, size_t size)
        /* Add MP case. */
        if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL
            || attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
-               snprintf(buf + strlen(buf), size - strlen(buf),
-                        ", mp_nexthop %s",
-                        inet_ntop(AF_INET6, &attr->mp_nexthop_global, addrbuf,
-                                  BUFSIZ));
+               snprintfrr(buf + strlen(buf), size - strlen(buf),
+                          ", mp_nexthop %pI6", &attr->mp_nexthop_global);
 
        if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL)
-               snprintf(buf + strlen(buf), size - strlen(buf), "(%s)",
-                        inet_ntop(AF_INET6, &attr->mp_nexthop_local, addrbuf,
-                                  BUFSIZ));
+               snprintfrr(buf + strlen(buf), size - strlen(buf), "(%pI6)",
+                          &attr->mp_nexthop_local);
 
        if (attr->mp_nexthop_len == BGP_ATTR_NHLEN_IPV4)
                snprintfrr(buf, size, "nexthop %pI4", &attr->nexthop);
@@ -1415,9 +1410,7 @@ DEFUN (no_debug_bgp_update_direct_peer,
        return CMD_SUCCESS;
 }
 
-#ifndef VTYSH_EXTRACT_PL
 #include "bgpd/bgp_debug_clippy.c"
-#endif
 
 DEFPY (debug_bgp_update_prefix_afi_safi,
        debug_bgp_update_prefix_afi_safi_cmd,