summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/bgp/packets.c')
-rw-r--r--proto/bgp/packets.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 2baa6e34..af7ce0c4 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -1077,16 +1077,16 @@ static struct {
/**
* bgp_error_dsc - return BGP error description
- * @buff: temporary buffer
* @code: BGP error code
* @subcode: BGP error subcode
*
* bgp_error_dsc() returns error description for BGP errors
* which might be static string or given temporary buffer.
*/
-const byte *
-bgp_error_dsc(byte *buff, unsigned code, unsigned subcode)
+const char *
+bgp_error_dsc(unsigned code, unsigned subcode)
{
+ static char buff[32];
unsigned i;
for (i=0; i < ARRAY_SIZE(bgp_msg_table); i++)
if (bgp_msg_table[i].major == code && bgp_msg_table[i].minor == subcode)
@@ -1102,7 +1102,6 @@ void
bgp_log_error(struct bgp_proto *p, u8 class, char *msg, unsigned code, unsigned subcode, byte *data, unsigned len)
{
const byte *name;
- byte namebuf[32];
byte *t, argbuf[36];
unsigned i;
@@ -1110,7 +1109,7 @@ bgp_log_error(struct bgp_proto *p, u8 class, char *msg, unsigned code, unsigned
if (code == 6 && class == BE_BGP_TX)
return;
- name = bgp_error_dsc(namebuf, code, subcode);
+ name = bgp_error_dsc(code, subcode);
t = argbuf;
if (len)
{