From: Mark Stapp Date: Thu, 20 Aug 2020 18:13:34 +0000 (-0400) Subject: zebra: use smaller stream buffer for zapi route notifications X-Git-Tag: base_7.6~258^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=55e74ca925f0457bb42be4e26d8ff5d0e314edb6;p=matthieu%2Ffrr.git zebra: use smaller stream buffer for zapi route notifications The owner-notification zapi message is small; use a small buffer for it. Signed-off-by: Mark Stapp --- diff --git a/lib/zclient.h b/lib/zclient.h index 231fdad09b..d9237048bd 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -54,6 +54,7 @@ typedef uint16_t zebra_size_t; /* For input/output buffer to zebra. */ #define ZEBRA_MAX_PACKET_SIZ 16384U +#define ZEBRA_SMALL_PACKET_SIZE 200U /* Zebra header size. */ #define ZEBRA_HEADER_SIZE 10 diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 1d68019909..f7c123231e 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -764,7 +764,11 @@ static int route_notify_internal(const struct prefix *p, int type, "Notifying Owner: %s about prefix %pFX(%u) %d vrf: %u", zebra_route_string(type), p, table_id, note, vrf_id); - s = stream_new(ZEBRA_MAX_PACKET_SIZ); + /* We're just allocating a small-ish buffer here, since we only + * encode a small amount of data. + */ + s = stream_new(ZEBRA_SMALL_PACKET_SIZE); + stream_reset(s); zclient_create_header(s, ZEBRA_ROUTE_NOTIFY_OWNER, vrf_id);