summaryrefslogtreecommitdiffstats
path: root/proto/bgp/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-07 00:19:23 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-07 00:19:23 +0200
commitb8113a5e92cb19a0910041d5708f4eafeb713b54 (patch)
treec4882fd498ecd33c12363272368277ca239466da /proto/bgp/packets.c
parentc429d4a4ba2cc8778634461e8adea33e0f0ae022 (diff)
downloadbird-b8113a5e92cb19a0910041d5708f4eafeb713b54.tar
bird-b8113a5e92cb19a0910041d5708f4eafeb713b54.zip
Implements BGP 'show protocols' info details.
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 2baa6e3..af7ce0c 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)
{