diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-05-26 18:41:55 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-05-27 01:21:20 +0200 |
commit | 762e563e522af9f5bfd843460c9940c1afae7061 (patch) | |
tree | 31c875c0ca4ce37a0dd7e125461765c127801200 /pimd/pim_zlookup.c | |
parent | debian: Add test_igmpv3_join to packaging (diff) | |
download | frr-762e563e522af9f5bfd843460c9940c1afae7061.tar.xz frr-762e563e522af9f5bfd843460c9940c1afae7061.zip |
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 <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | pimd/pim_zlookup.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index 9b572963a..0ca3da20a 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); |