]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: fix zserv_read rescheduling
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 26 Apr 2018 04:19:40 +0000 (00:19 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 29 May 2018 19:06:16 +0000 (19:06 +0000)
Incorrect decrement operation resulted in always rescheduling instead of
only when needed.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
zebra/zserv.c

index 740926e1afa853792851c654e92752eab44f6475..1effb2b2b4d0de0213d7cf7841521dd18d341845 100644 (file)
@@ -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) {