From 107afcd10b59be3441e2b1f358942ca5e760daa2 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 9 Mar 2018 15:59:39 -0500 Subject: [PATCH] lib, zebra: clean up zapi nits * Get correct data size when parsing VRF ids * Move some vars into smaller scope Signed-off-by: Quentin Young --- lib/zclient.c | 2 +- zebra/zserv.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/zclient.c b/lib/zclient.c index 20aaaca161..c720e2519b 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -327,7 +327,7 @@ bool zapi_parse_header(struct stream *zmsg, struct zmsghdr *hdr) STREAM_GETW(zmsg, hdr->length); STREAM_GETC(zmsg, hdr->marker); STREAM_GETC(zmsg, hdr->version); - STREAM_GETC(zmsg, hdr->vrf_id); + STREAM_GETL(zmsg, hdr->vrf_id); STREAM_GETW(zmsg, hdr->command); return true; stream_failure: diff --git a/zebra/zserv.c b/zebra/zserv.c index ac2fe9c0e2..4cdb97be42 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2850,11 +2850,6 @@ static int zserv_read(struct thread *thread) #else int packets = zebrad.packets_to_process; #endif - struct zmsghdr hdr; - ssize_t nb; - bool hdrvalid; - char errmsg[256]; - /* Get thread data. Reset reading thread because I'm running. */ sock = THREAD_FD(thread); client = THREAD_ARG(thread); @@ -2865,6 +2860,11 @@ static int zserv_read(struct thread *thread) } while (packets) { + struct zmsghdr hdr; + ssize_t nb; + bool hdrvalid; + char errmsg[256]; + already = stream_get_endp(client->ibuf_work); /* Read length and command (if we don't have it already). */ -- 2.39.5