]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: use smaller stream buffer for zapi route notifications
authorMark Stapp <mjs@voltanet.io>
Thu, 20 Aug 2020 18:13:34 +0000 (14:13 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Sun, 15 Nov 2020 19:50:17 +0000 (14:50 -0500)
The owner-notification zapi message is small; use a small buffer
for it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/zclient.h
zebra/zapi_msg.c

index 231fdad09badd34923d325d8505995bd1f7c12fe..d9237048bdb0e9c61ba7c9b2dbf9617c8959fe4a 100644 (file)
@@ -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
index 1d68019909d6a669c0e7c65ab4730cfa71f3ba27..f7c123231e134b76ee491a06de35ebdd71bb9111 100644 (file)
@@ -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);