diff options
-rw-r--r-- | lib/zclient.c | 7 | ||||
-rw-r--r-- | pimd/pim_zlookup.c | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index b6d3aa9fe..ef9516c91 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -347,6 +347,13 @@ zclient_read_header (struct stream *s, int sock, u_int16_t *size, u_char *marker *vrf_id = stream_getw (s); *cmd = stream_getw (s); + if (*version != ZSERV_VERSION || *marker != ZEBRA_HEADER_MARKER) + { + zlog_err("%s: socket %d version mismatch, marker %d, version %d", + __func__, sock, *marker, *version); + return -1; + } + if (*size && stream_read (s, sock, *size) != *size) return -1; diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index aa2f7eb4c..1f8cdfa07 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -189,13 +189,6 @@ static int zclient_read_nexthop(struct zclient *zlookup, zclient_lookup_failed(zlookup); return -2; } - - if (version != ZSERV_VERSION || marker != ZEBRA_HEADER_MARKER) { - zlog_err("%s: socket %d version mismatch, marker %d, version %d", - __func__, zlookup->sock, marker, version); - zclient_lookup_failed(zlookup); - return -4; - } } raddr.s_addr = stream_get_ipv4(s); |