From 43ea2c7609c953b1e553494374e277a9fc2d9b69 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 26 Apr 2018 00:19:40 -0400 Subject: [PATCH] zebra: fix zserv_read rescheduling Incorrect decrement operation resulted in always rescheduling instead of only when needed. Signed-off-by: Quentin Young --- zebra/zserv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zebra/zserv.c b/zebra/zserv.c index 740926e1af..1effb2b2b4 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -299,7 +299,7 @@ static int zserv_read(struct thread *thread) sock = THREAD_FD(thread); client = THREAD_ARG(thread); - while (p2p--) { + while (p2p) { ssize_t nb; bool hdrvalid; char errmsg[256]; @@ -392,6 +392,7 @@ static int zserv_read(struct thread *thread) stream_fifo_push(cache, msg); stream_reset(client->ibuf_work); + p2p--; } if (p2p < p2p_orig) { -- 2.39.5