From c0079fc9ce112a265a76688fd40cc0a1fadee0b5 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 29 Mar 2018 08:52:39 -0400 Subject: [PATCH] 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 --- zebra/zserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)