]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra, lib: bugfix on zebra packet debugging
authorWesley Coakley <wcoakley@cumulusnetworks.com>
Thu, 28 May 2020 14:41:10 +0000 (10:41 -0400)
committerWesley Coakley <wcoakley@cumulusnetworks.com>
Thu, 28 May 2020 14:48:56 +0000 (10:48 -0400)
`debug zebra packet detail` dumps the full message whereas
it had been dropping exactly 10 bytes, the size of the zebra header

Signed-off-by: Wesley Coakley <wcoakley@cumulusnetworks.com>
lib/stream.c
lib/stream.h
zebra/zserv.c

index 683a130e446fd0c21150f3a1cd2b6fad2c6e359b..b378ab62a5094e017a91fd9f0bb194d0b65bdd53 100644 (file)
@@ -1122,6 +1122,11 @@ int stream_flush(struct stream *s, int fd)
        return nbytes;
 }
 
+void stream_hexdump(struct stream *s)
+{
+       zlog_hexdump(s->data, s->endp);
+}
+
 /* Stream first in first out queue. */
 
 struct stream_fifo *stream_fifo_new(void)
index 5c7d94fab8f822978e29f04767fa5c2db5c50dda..f84f028852a21a994670ebc4355860bb026ac375 100644 (file)
@@ -252,6 +252,9 @@ extern void stream_reset(struct stream *);
 extern int stream_flush(struct stream *, int);
 extern int stream_empty(struct stream *); /* is the stream empty? */
 
+/* debugging */
+extern void stream_hexdump(struct stream *);
+
 /* deprecated */
 extern uint8_t *stream_pnt(struct stream *);
 
index 8a1ed115a7f99fd37377c67773896f9b1aa3dc9b..9d6ae2ec2e229fee23b371efe2c0ffcc08b3904f 100644 (file)
@@ -160,7 +160,7 @@ void zserv_log_message(const char *errmsg, struct stream *msg,
                zlog_debug("Command: %s", zserv_command_string(hdr->command));
                zlog_debug("    VRF: %u", hdr->vrf_id);
        }
-       zlog_hexdump(msg->data, STREAM_READABLE(msg));
+       stream_hexdump(msg);
 }
 
 /*