mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 06:53:03 +00:00
Merge pull request #4233 from qlyoung/fix-zapi-msg-debugs
zebra: fix zapi msg debugging dumps
This commit is contained in:
commit
b1ad7351a5
@ -2507,6 +2507,9 @@ void zserv_handle_commands(struct zserv *client, struct stream *msg)
|
|||||||
|
|
||||||
zapi_parse_header(msg, &hdr);
|
zapi_parse_header(msg, &hdr);
|
||||||
|
|
||||||
|
if (IS_ZEBRA_DEBUG_PACKET && IS_ZEBRA_DEBUG_RECV)
|
||||||
|
zserv_log_message(NULL, msg, &hdr);
|
||||||
|
|
||||||
#if defined(HANDLE_ZAPI_FUZZING)
|
#if defined(HANDLE_ZAPI_FUZZING)
|
||||||
zserv_write_incoming(msg, hdr.command);
|
zserv_write_incoming(msg, hdr.command);
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,8 +149,8 @@ static void zserv_event(struct zserv *client, enum zserv_event event);
|
|||||||
* hdr (optional)
|
* hdr (optional)
|
||||||
* The message header
|
* The message header
|
||||||
*/
|
*/
|
||||||
static void zserv_log_message(const char *errmsg, struct stream *msg,
|
void zserv_log_message(const char *errmsg, struct stream *msg,
|
||||||
struct zmsghdr *hdr)
|
struct zmsghdr *hdr)
|
||||||
{
|
{
|
||||||
zlog_debug("Rx'd ZAPI message");
|
zlog_debug("Rx'd ZAPI message");
|
||||||
if (errmsg)
|
if (errmsg)
|
||||||
@ -411,9 +411,6 @@ static int zserv_read(struct thread *thread)
|
|||||||
hdr.vrf_id, hdr.length,
|
hdr.vrf_id, hdr.length,
|
||||||
sock);
|
sock);
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_PACKET && IS_ZEBRA_DEBUG_RECV)
|
|
||||||
zserv_log_message(NULL, client->ibuf_work, &hdr);
|
|
||||||
|
|
||||||
stream_set_getp(client->ibuf_work, 0);
|
stream_set_getp(client->ibuf_work, 0);
|
||||||
struct stream *msg = stream_dup(client->ibuf_work);
|
struct stream *msg = stream_dup(client->ibuf_work);
|
||||||
|
|
||||||
|
@ -240,6 +240,22 @@ extern struct zserv *zserv_find_client(uint8_t proto, unsigned short instance);
|
|||||||
*/
|
*/
|
||||||
extern void zserv_close_client(struct zserv *client);
|
extern void zserv_close_client(struct zserv *client);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Log a ZAPI message hexdump.
|
||||||
|
*
|
||||||
|
* errmsg
|
||||||
|
* Error message to include with packet hexdump
|
||||||
|
*
|
||||||
|
* msg
|
||||||
|
* Message to log
|
||||||
|
*
|
||||||
|
* hdr
|
||||||
|
* Message header
|
||||||
|
*/
|
||||||
|
void zserv_log_message(const char *errmsg, struct stream *msg,
|
||||||
|
struct zmsghdr *hdr);
|
||||||
|
|
||||||
#if defined(HANDLE_ZAPI_FUZZING)
|
#if defined(HANDLE_ZAPI_FUZZING)
|
||||||
extern void zserv_read_file(char *input);
|
extern void zserv_read_file(char *input);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user