diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/prefix.c | 6 | ||||
| -rw-r--r-- | lib/prefix.h | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 59acc7c22e..35bc3b3b6f 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -1166,7 +1166,7 @@ const char *bgp_linkstate_nlri_type_2str(uint16_t nlri_type) const char *prefix2str(union prefixconstptr pu, char *str, int size) { const struct prefix *p = pu.p; - char buf[PREFIX2STR_BUFFER]; + char buf[PREFIX_STRLEN_EXTENDED]; int byte, tmp, a, b; bool z = false; size_t l; @@ -1234,7 +1234,7 @@ const char *prefix2str(union prefixconstptr pu, char *str, int size) static ssize_t prefixhost2str(struct fbuf *fbuf, union prefixconstptr pu) { const struct prefix *p = pu.p; - char buf[PREFIX2STR_BUFFER]; + char buf[PREFIX_STRLEN_EXTENDED]; switch (p->family) { case AF_INET: @@ -1752,7 +1752,7 @@ static ssize_t printfrr_pfx(struct fbuf *buf, struct printfrr_eargs *ea, if (host_only) return prefixhost2str(buf, (struct prefix *)ptr); else { - char cbuf[PREFIX_STRLEN]; + char cbuf[PREFIX_STRLEN_EXTENDED]; prefix2str(ptr, cbuf, sizeof(cbuf)); return bputs(buf, cbuf); diff --git a/lib/prefix.h b/lib/prefix.h index dacdbf9059..f1aff43689 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -347,6 +347,11 @@ union prefixconstptr { /* Maximum string length of the result of prefix2str */ #define PREFIX_STRLEN 80 +/* Maximum string length of the result of prefix2str for + * long string prefixes (eg. BGP Link-State) + */ +#define PREFIX_STRLEN_EXTENDED 512 + /* * Longest possible length of a (S,G) string is 34 bytes * 123.123.123.123 = 15 * 2 |
