summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2019-10-09 15:33:22 -0400
committerGitHub <noreply@github.com>2019-10-09 15:33:22 -0400
commit364af5fd27714a5ba96abe58901feac1b0e3c3fe (patch)
tree0b1e5d6defad12235a010ad0a115c900b36501fc
parentc93f27d52f6ed58456ae5a60cefba64a56bb2580 (diff)
parentf6aea80e1d61d170a6a77a304e520eeebd090e9d (diff)
Merge pull request #5115 from ton31337/feature/maximum-prefix_uint64_to_uint32_7.2
bgpd: [7.2] Use uint32_t for maximum-prefix
-rw-r--r--bgpd/bgp_route.c9
-rw-r--r--bgpd/bgp_vty.c13
-rw-r--r--bgpd/bgpd.c2
-rw-r--r--bgpd/bgpd.h4
4 files changed, 16 insertions, 12 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index e7923a10de..9dc4a294c4 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2748,8 +2748,8 @@ int bgp_maximum_prefix_overflow(struct peer *peer, afi_t afi, safi_t safi,
return 0;
zlog_info(
- "%%MAXPFXEXCEED: No. of %s prefix received from %s %ld exceed, "
- "limit %ld",
+ "%%MAXPFXEXCEED: No. of %s prefix received from %s %" PRIu32
+ " exceed, limit %" PRIu32,
get_afi_safi_str(afi, safi, false), peer->host,
peer->pcount[afi][safi], peer->pmax[afi][safi]);
SET_FLAG(peer->af_sflags[afi][safi], PEER_STATUS_PREFIX_LIMIT);
@@ -2810,7 +2810,8 @@ int bgp_maximum_prefix_overflow(struct peer *peer, afi_t afi, safi_t safi,
return 0;
zlog_info(
- "%%MAXPFX: No. of %s prefix received from %s reaches %ld, max %ld",
+ "%%MAXPFX: No. of %s prefix received from %s reaches %" PRIu32
+ ", max %" PRIu32,
get_afi_safi_str(afi, safi, false), peer->host,
peer->pcount[afi][safi], peer->pmax[afi][safi]);
SET_FLAG(peer->af_sflags[afi][safi],
@@ -10976,7 +10977,7 @@ static int bgp_peer_counts(struct vty *vty, struct peer *peer, afi_t afi,
get_afi_safi_str(afi, safi, false));
}
- vty_out(vty, "PfxCt: %ld\n", peer->pcount[afi][safi]);
+ vty_out(vty, "PfxCt: %" PRIu32 "\n", peer->pcount[afi][safi]);
vty_out(vty, "\nCounts from RIB table walk:\n\n");
for (i = 0; i < PCOUNT_MAX; i++)
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 17bc83ed2e..4596cd6064 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8447,9 +8447,10 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
if (peer->status == Established)
if (peer->afc_recv[afi][safi])
- vty_out(vty, " %12ld",
- peer->pcount[afi]
- [pfx_rcd_safi]);
+ vty_out(vty, " %12" PRIu32,
+ peer->pcount
+ [afi]
+ [pfx_rcd_safi]);
else
vty_out(vty, " NoNeg");
else {
@@ -9345,11 +9346,13 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
filter->usmap.name);
/* Receive prefix count */
- vty_out(vty, " %ld accepted prefixes\n", p->pcount[afi][safi]);
+ vty_out(vty, " %" PRIu32 " accepted prefixes\n",
+ p->pcount[afi][safi]);
/* Maximum prefix */
if (CHECK_FLAG(p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX)) {
- vty_out(vty, " Maximum prefixes allowed %ld%s\n",
+ vty_out(vty,
+ " Maximum prefixes allowed %" PRIu32 "%s\n",
p->pmax[afi][safi],
CHECK_FLAG(p->af_flags[afi][safi],
PEER_FLAG_MAX_PREFIX_WARNING)
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 5b31fbb3a8..1a3a1036d8 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -7348,7 +7348,7 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
/* maximum-prefix. */
if (peergroup_af_flag_check(peer, afi, safi, PEER_FLAG_MAX_PREFIX)) {
- vty_out(vty, " neighbor %s maximum-prefix %lu", addr,
+ vty_out(vty, " neighbor %s maximum-prefix %" PRIu32, addr,
peer->pmax[afi][safi]);
if (peer->pmax_threshold[afi][safi]
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 077b2d5e6b..20e4b0aa31 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -1152,10 +1152,10 @@ struct peer {
int rcvd_attr_printed;
/* Prefix count. */
- unsigned long pcount[AFI_MAX][SAFI_MAX];
+ uint32_t pcount[AFI_MAX][SAFI_MAX];
/* Max prefix count. */
- unsigned long pmax[AFI_MAX][SAFI_MAX];
+ uint32_t pmax[AFI_MAX][SAFI_MAX];
uint8_t pmax_threshold[AFI_MAX][SAFI_MAX];
uint16_t pmax_restart[AFI_MAX][SAFI_MAX];
#define MAXIMUM_PREFIX_THRESHOLD_DEFAULT 75