From b8113a5e92cb19a0910041d5708f4eafeb713b54 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 7 Apr 2010 00:19:23 +0200 Subject: Implements BGP 'show protocols' info details. --- proto/bgp/packets.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'proto/bgp/packets.c') 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) { -- cgit v1.2.3