]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_debug.c
Merge pull request #9440 from dlqs/dplanehook2
[mirror_frr.git] / bgpd / bgp_debug.c
index ce1b7b552b598754cdb5fdaaa9796a6672aadb6c..856afb05f84b90d8920762c1b40af308b56b3a72 100644 (file)
@@ -2112,10 +2112,13 @@ DEFPY(debug_bgp_bfd, debug_bgp_bfd_cmd,
                        bfd_protocol_integration_set_debug(true);
                }
        } else {
-               if (no)
+               if (no) {
                        TERM_DEBUG_OFF(bfd, BFD_LIB);
-               else
+                       bfd_protocol_integration_set_debug(false);
+               } else {
                        TERM_DEBUG_ON(bfd, BFD_LIB);
+                       bfd_protocol_integration_set_debug(true);
+               }
        }
 
        return CMD_SUCCESS;
@@ -2677,10 +2680,14 @@ const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi,
                                    union prefixconstptr pu,
                                    mpls_label_t *label, uint32_t num_labels,
                                    int addpath_valid, uint32_t addpath_id,
+                                   struct bgp_route_evpn *overlay_index,
                                    char *str, int size)
 {
        char rd_buf[RD_ADDRSTRLEN];
        char tag_buf[30];
+       char overlay_index_buf[INET6_ADDRSTRLEN + 14];
+       const struct prefix_evpn *evp;
+
        /* ' with addpath ID '          17
         * max strlen of uint32       + 10
         * +/- (just in case)         +  1
@@ -2698,6 +2705,23 @@ const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi,
                snprintf(pathid_buf, sizeof(pathid_buf), " with addpath ID %u",
                         addpath_id);
 
+       overlay_index_buf[0] = '\0';
+       if (overlay_index && overlay_index->type == OVERLAY_INDEX_GATEWAY_IP) {
+               char obuf[INET6_ADDRSTRLEN];
+
+               obuf[0] = '\0';
+               evp = pu.evp;
+               if (is_evpn_prefix_ipaddr_v4(evp))
+                       inet_ntop(AF_INET, &overlay_index->gw_ip, obuf,
+                                 sizeof(obuf));
+               else if (is_evpn_prefix_ipaddr_v6(evp))
+                       inet_ntop(AF_INET6, &overlay_index->gw_ip, obuf,
+                                 sizeof(obuf));
+
+               snprintf(overlay_index_buf, sizeof(overlay_index_buf),
+                        " gateway IP %s", obuf);
+       }
+
        tag_buf[0] = '\0';
        if (bgp_labeled_safi(safi) && num_labels) {
 
@@ -2717,9 +2741,10 @@ const char *bgp_debug_rdpfxpath2str(afi_t afi, safi_t safi,
        }
 
        if (prd)
-               snprintfrr(str, size, "RD %s %pFX%s%s %s %s",
+               snprintfrr(str, size, "RD %s %pFX%s%s%s %s %s",
                           prefix_rd2str(prd, rd_buf, sizeof(rd_buf)), pu.p,
-                          tag_buf, pathid_buf, afi2str(afi), safi2str(safi));
+                          overlay_index_buf, tag_buf, pathid_buf, afi2str(afi),
+                          safi2str(safi));
        else if (safi == SAFI_FLOWSPEC) {
                char return_string[BGP_FLOWSPEC_NLRI_STRING_MAX];
                const struct prefix_fs *fs = pu.fs;