diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-05-31 16:20:38 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-31 16:20:38 -0400 |
| commit | 32e4ce5fd522000e285dcda2da1038a4f49d731c (patch) | |
| tree | aca3c69450935a0528bb6618f6322a35292b452e /zebra/zserv.c | |
| parent | ce231fbc872650f5ecd2415b99df259fa2f81377 (diff) | |
| parent | f3f45626125b117b4dc25498fced056da41bb493 (diff) | |
Merge pull request #4435 from donaldsharp/zclient_buffer_sizing
lib, zebra: Ensure route encoding has enough space
Diffstat (limited to 'zebra/zserv.c')
| -rw-r--r-- | zebra/zserv.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c index fbb5af875d..49fb302ba8 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -682,6 +682,8 @@ static int zserv_handle_client_fail(struct thread *thread) static struct zserv *zserv_client_create(int sock) { struct zserv *client; + size_t stream_size = + MAX(ZEBRA_MAX_PACKET_SIZ, sizeof(struct zapi_route)); int i; afi_t afi; @@ -691,8 +693,8 @@ static struct zserv *zserv_client_create(int sock) client->sock = sock; client->ibuf_fifo = stream_fifo_new(); client->obuf_fifo = stream_fifo_new(); - client->ibuf_work = stream_new(ZEBRA_MAX_PACKET_SIZ); - client->obuf_work = stream_new(ZEBRA_MAX_PACKET_SIZ); + client->ibuf_work = stream_new(stream_size); + client->obuf_work = stream_new(stream_size); pthread_mutex_init(&client->ibuf_mtx, NULL); pthread_mutex_init(&client->obuf_mtx, NULL); client->wb = buffer_new(0); |
