summaryrefslogtreecommitdiffstats
path: root/lib/zclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zclient.c')
-rw-r--r--lib/zclient.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index a0956324..0ce46fef 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -315,6 +315,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;