]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: route detail output local pref display
authorChirag Shah <chirag@cumulusnetworks.com>
Thu, 26 Jul 2018 04:57:54 +0000 (21:57 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Fri, 27 Jul 2018 22:33:26 +0000 (15:33 -0700)
Avoid displaying default configured local preference as
part of bgp route's detail output.
Local preference is for iBGP learnt route's. The value could be
default (100) or configured value (via routemap or local pref config cmd).
show bgp afi safi (brief output) does not display,
if the local pref attribute is not set.
Similarly, show bgp afi safi detail route output should display
if the the attribute is set, and should not display configured value.
This way both output would be consistent.
The configured local preference can be seen via running-config.

Ticket:CM-12769
Reviewed By:
Testing Done:

eBGP output:
show bgp ipv4 45.0.3.0/24
BGP routing table entry for 45.0.3.0/24
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  MSP1(uplink-1) MSP2(uplink-2)
  Local
    0.0.0.0 from 0.0.0.0 (27.0.0.9)
      Origin incomplete, metric 0, weight 32768, valid,sourced, bestpath-from-AS Local, best
      AddPath ID: RX 0, TX 7
      Last update: Thu Jul 26 02:10:02 2018

iBGP output:

show bgp ipv4 unicast 6.0.0.16/32
BGP routing table entry for 6.0.0.16/32
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  Local
    6.0.0.16 (metric 20) from tor-12(6.0.0.16) (6.0.0.16)
      Origin incomplete, metric 0, localpref 100, valid, internal, bestpath-from-AS Local, best
      AddPath ID: RX 0, TX 13
      Last update: Thu Jul 26 05:26:18 2018

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
bgpd/bgp_route.c

index 9ba9eb1e59e551c31ca2051abd71227e3b581cd3..4126037bf7076ec502c9d9c3c46bf8f1a45aa415 100644 (file)
@@ -7737,13 +7737,6 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p,
                        else
                                vty_out(vty, ", localpref %u",
                                        attr->local_pref);
-               } else {
-                       if (json_paths)
-                               json_object_int_add(json_path, "localpref",
-                                                   bgp->default_local_pref);
-                       else
-                               vty_out(vty, ", localpref %u",
-                                       bgp->default_local_pref);
                }
 
                if (attr->weight != 0) {