]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_nexthop.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / bgpd / bgp_nexthop.c
index 77e26037c0eea0e918ba809435c0d214c86dcfdf..00a0bc84023e91abf8ee4ed0d4bcd1f0255c8516 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BGP nexthop scan
  * Copyright (C) 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -817,6 +802,7 @@ static void bgp_show_nexthop_paths(struct vty *vty, struct bgp *bgp,
                safi = table->safi;
                bgp_path = table->bgp;
 
+
                if (json) {
                        json_path = json_object_new_object();
                        json_object_string_add(json_path, "afi", afi2str(afi));
@@ -826,7 +812,8 @@ static void bgp_show_nexthop_paths(struct vty *vty, struct bgp *bgp,
                                                dest);
                        if (dest->pdest)
                                json_object_string_addf(
-                                       json_path, "rd", "%pRD",
+                                       json_path, "rd",
+                                       BGP_RD_AS_FORMAT(bgp->asnotation),
                                        (struct prefix_rd *)bgp_dest_get_prefix(
                                                dest->pdest));
                        json_object_string_add(
@@ -836,13 +823,14 @@ static void bgp_show_nexthop_paths(struct vty *vty, struct bgp *bgp,
                        json_object_array_add(paths, json_path);
                        continue;
                }
-               if (dest->pdest)
-                       vty_out(vty, "    %d/%d %pBD RD %pRD %s flags 0x%x\n",
-                               afi, safi, dest,
+               if (dest->pdest) {
+                       vty_out(vty, "    %d/%d %pBD RD ", afi, safi, dest);
+                       vty_out(vty, BGP_RD_AS_FORMAT(bgp->asnotation),
                                (struct prefix_rd *)bgp_dest_get_prefix(
-                                       dest->pdest),
-                               bgp_path->name_pretty, path->flags);
-               else
+                                       dest->pdest));
+                       vty_out(vty, " %s flags 0x%x\n", bgp_path->name_pretty,
+                               path->flags);
+               } else
                        vty_out(vty, "    %d/%d %pBD %s flags 0x%x\n",
                                afi, safi, dest, bgp_path->name_pretty, path->flags);
        }