diff options
| author | Russ White <russ@riw.us> | 2023-05-16 10:14:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-16 10:14:04 -0400 |
| commit | 18978d12809fb67160f7428f5054249fca934afc (patch) | |
| tree | f5717ebc4cec382854eae7280714723a9a74dd79 | |
| parent | 425fc1f5b7f42c16d27ecdc602546d4521793d6f (diff) | |
| parent | f913ee30fffd17102d60e96a559ad8bf85e43bef (diff) | |
Merge pull request #13526 from opensourcerouting/fix/show_table_version_per_subgrp
bgpd: Show the real table version for a decent peer subgroup
| -rw-r--r-- | bgpd/bgp_vty.c | 13 | ||||
| -rw-r--r-- | bgpd/bgpd.h | 1 | ||||
| -rw-r--r-- | tests/topotests/evpn_pim_1/spine/bgp.summ.json | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 1be44adde8..7ef9db9f0d 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -11620,8 +11620,11 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, &peer->ibuf->count, memory_order_relaxed); - json_object_int_add(json_peer, "tableVersion", - peer->version[afi][safi]); + json_object_int_add( + json_peer, "tableVersion", + (paf && PAF_SUBGRP(paf)) + ? paf->subgroup->version + : 0); json_object_int_add(json_peer, "outq", outq_count); json_object_int_add(json_peer, "inq", @@ -11799,8 +11802,10 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, " %9u %9u %8" PRIu64 " %4zu %4zu %8s", PEER_TOTAL_RX(peer), PEER_TOTAL_TX(peer), - peer->version[afi][safi], inq_count, - outq_count, + (paf && PAF_SUBGRP(paf)) + ? paf->subgroup->version + : 0, + inq_count, outq_count, peer_uptime(peer->uptime, timebuf, BGP_UPTIME_LEN, 0, NULL)); diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 68b32b5945..9cb1d51088 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -1119,7 +1119,6 @@ struct peer { /* BGP peer group. */ struct peer_group *group; - uint64_t version[AFI_MAX][SAFI_MAX]; /* BGP peer_af structures, per configured AF on this peer */ struct peer_af *peer_af_array[BGP_AF_MAX]; diff --git a/tests/topotests/evpn_pim_1/spine/bgp.summ.json b/tests/topotests/evpn_pim_1/spine/bgp.summ.json index 5ff4b096fd..7f37cedb2b 100644 --- a/tests/topotests/evpn_pim_1/spine/bgp.summ.json +++ b/tests/topotests/evpn_pim_1/spine/bgp.summ.json @@ -8,7 +8,6 @@ "192.168.1.2":{ "remoteAs":65002, "version":4, - "tableVersion":0, "outq":0, "inq":0, "pfxRcd":3, @@ -21,7 +20,6 @@ "192.168.2.3":{ "remoteAs":65003, "version":4, - "tableVersion":0, "outq":0, "inq":0, "pfxRcd":3, |
