]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib, zebra: clean up zapi nits
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 9 Mar 2018 20:59:39 +0000 (15:59 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 12 Mar 2018 18:57:06 +0000 (14:57 -0400)
* Get correct data size when parsing VRF ids
* Move some vars into smaller scope

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

index 20aaaca161c3314c980acc9eda9017693113675c..c720e2519bd2eb6159aee1b8c26ef32cf09ba332 100644 (file)
@@ -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:
index ac2fe9c0e21913b7c85de6f6365481267750f507..4cdb97be42c922d2f4716ddbf3fb006deec3b165 100644 (file)
@@ -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). */