summaryrefslogtreecommitdiff
path: root/bgpd/bgp_debug.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-13 09:18:14 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-06-13 09:18:14 +0200
commit97bd5c48de49f1a25c6fb979f0ca151412fbd61b (patch)
tree924b30812e7ae8d9d2f7c897b4ebbbf19802eff8 /bgpd/bgp_debug.c
parentcea34723daeb767a5b92fa5800ebed81e3f690b6 (diff)
parentad2e2470f63e3fac228b6cc532dfe36a0794a846 (diff)
Merge remote-tracking branch 'frr/master' into pull-624
Diffstat (limited to 'bgpd/bgp_debug.c')
-rw-r--r--bgpd/bgp_debug.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index f4722e62dc..a39ec90cc6 100644
--- a/bgpd/bgp_debug.c
+++ b/bgpd/bgp_debug.c
@@ -40,8 +40,6 @@
#include "bgpd/bgp_updgrp.h"
#include "bgpd/bgp_mplsvpn.h"
-#define BGP_ADDPATH_STR 20
-
unsigned long conf_bgp_debug_as4;
unsigned long conf_bgp_debug_neighbor_events;
unsigned long conf_bgp_debug_events;
@@ -2139,7 +2137,12 @@ bgp_debug_rdpfxpath2str (struct prefix_rd *prd, union prefixconstptr pu,
{
char rd_buf[RD_ADDRSTRLEN];
char pfx_buf[PREFIX_STRLEN];
- char pathid_buf[BGP_ADDPATH_STR];
+ /* ' with addpath ID ' 17
+ * max strlen of uint32 + 10
+ * +/- (just in case) + 1
+ * null terminator + 1
+ * ============================ 29 */
+ char pathid_buf[30];
if (size < BGP_PRD_PATH_STRLEN)
return NULL;
@@ -2147,7 +2150,7 @@ bgp_debug_rdpfxpath2str (struct prefix_rd *prd, union prefixconstptr pu,
/* Note: Path-id is created by default, but only included in update sometimes. */
pathid_buf[0] = '\0';
if (addpath_valid)
- sprintf(pathid_buf, " with addpath ID %d", addpath_id);
+ snprintf(pathid_buf, sizeof(pathid_buf), " with addpath ID %u", addpath_id);
if (prd)
snprintf (str, size, "RD %s %s%s",