]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: extend sbuf size
authorLouis Scalbert <louis.scalbert@6wind.com>
Tue, 27 Sep 2022 10:22:24 +0000 (12:22 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 10 Feb 2023 10:31:05 +0000 (11:31 +0100)
sbuf variable is used among other things to store IS-IS database output.
Future commits will introduce the output of extended access groups in
the "show isis database detail" output.

Extend the sbuf size to have chance to store all information.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
lib/sbuf.c
lib/sbuf.h

index c04af153b19c01f365219cf89b81420bddbb2055..3f1b02eaf8e92ffc81794df9a4712408d458c438 100644 (file)
@@ -33,8 +33,8 @@ void sbuf_init(struct sbuf *dest, char *buf, size_t size)
                dest->buf = buf;
                dest->size = size;
        } else {
-               dest->buf = XMALLOC(MTYPE_TMP, 4096);
-               dest->size = 4096;
+               dest->buf = XMALLOC(MTYPE_TMP, SBUF_DEFAULT_SIZE);
+               dest->size = SBUF_DEFAULT_SIZE;
        }
 
        dest->pos = 0;
index aaa2db0edb8dad893ce46e6054131f5bfa7aa55f..e5a43c0e37f0c2d7077eb3257ef243376b5137bb 100644 (file)
@@ -64,6 +64,8 @@ extern "C" {
  * the string returned in parser_log.
  */
 
+#define SBUF_DEFAULT_SIZE 8192
+
 struct sbuf {
        bool fixed;
        char *buf;