summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-03-29 08:52:39 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-03-29 08:52:39 -0400
commitc0079fc9ce112a265a76688fd40cc0a1fadee0b5 (patch)
treeeb6d40d269f410edd3e0cd00ba3e11a5262b2e82
parent615e608d76bd3e1acf1769c914142210ac88e3f7 (diff)
zebra: Subtract header length in the right spot
The header length needs to be subtracted from the handling side of the zapi in zebra. This is because we refigure the header data structure. The receive side doesn't care about the total header length so no need to subtract there. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/zserv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 538487a9cd..e3d726b422 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -2927,6 +2927,7 @@ static int zserv_process_messages(struct thread *thread)
if (!hdrvalid)
continue;
+ hdr.length -= ZEBRA_HEADER_SIZE;
/* lookup vrf */
zvrf = zebra_vrf_lookup_by_id(hdr.vrf_id);
if (!zvrf && IS_ZEBRA_DEBUG_PACKET && IS_ZEBRA_DEBUG_RECV) {
@@ -3047,7 +3048,6 @@ static int zserv_read(struct thread *thread)
#if defined(HANDLE_ZAPI_FUZZING)
zserv_write_incoming(client->ibuf_work, command);
#endif
- hdr.length -= ZEBRA_HEADER_SIZE;
/* Debug packet information. */
if (IS_ZEBRA_DEBUG_EVENT)