From 762e563e522af9f5bfd843460c9940c1afae7061 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 26 May 2016 12:41:55 -0400 Subject: [PATCH] pimd: Double read of stream The addition of the zclient_read_header call reads the entirety of the stream for you and makes sure it's consistent with the header. When the function call was added it read the stream data in zclient_read_header and then reread the data after that. Signed-off-by: Donald Sharp --- pimd/pim_zlookup.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index 9b572963a3..0ca3da20a0 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -155,7 +155,6 @@ static int zclient_read_nexthop(struct zclient *zlookup, u_char version; uint16_t vrf_id; uint16_t command; - int nbytes; struct in_addr raddr; uint8_t distance; uint32_t metric; @@ -189,14 +188,6 @@ static int zclient_read_nexthop(struct zclient *zlookup, return -2; } - nbytes = stream_read(s, zlookup->sock, length); - if (nbytes < length) { - zlog_err("%s %s: failure reading zclient lookup socket: nbytes=%d < len=%d", - __FILE__, __PRETTY_FUNCTION__, nbytes, length); - zclient_lookup_failed(zlookup); - return -3; - } - if (version != ZSERV_VERSION || marker != ZEBRA_HEADER_MARKER) { zlog_err("%s: socket %d version mismatch, marker %d, version %d", __func__, zlookup->sock, marker, version); -- 2.39.5