]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Show neighbors software version if description is not set
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 7 Jul 2023 07:14:51 +0000 (10:14 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 7 Jul 2023 07:21:27 +0000 (10:21 +0300)
Also, this is visible only if `capability software-version` is enabled.

Example:

```
r1# show ip bgp summary

IPv4 Unicast Summary (VRF default):
BGP router identifier 192.168.1.1, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 725 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.1.2     4      65002        54        54        0    0    0 00:00:52            0        0 FRRouting/9.1-dev-My

Total number of neighbors 1
r1#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_vty.c

index e1cc59a318190a41f535b1e3ac5cbe146fc6aba4..ee0098bf5aab4df4199522e933d8db514c093d63 100644 (file)
@@ -11930,14 +11930,23 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                }
                                /* Make sure `Desc` column is the lastest in
                                 * the output.
+                                * If the description is not set, try
+                                * to print the software version if the
+                                * capability is enabled and received.
                                 */
                                if (peer->desc)
                                        vty_out(vty, " %s",
                                                bgp_peer_description_stripped(
                                                        peer->desc,
                                                        show_wide ? 64 : 20));
-                               else
+                               else if (peer->soft_version) {
+                                       vty_out(vty, " %s",
+                                               bgp_peer_description_stripped(
+                                                       peer->soft_version,
+                                                       show_wide ? 64 : 20));
+                               } else {
                                        vty_out(vty, " N/A");
+                               }
                                vty_out(vty, "\n");
                        }