diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c --- a/usr.sbin/bhyve/rfb.c +++ b/usr.sbin/bhyve/rfb.c @@ -887,10 +887,12 @@ len = stream_read(cfd, buf, VERSION_LENGTH); if (len == VERSION_LENGTH && !strncmp(vbuf, buf, VERSION_LENGTH - 2)) { client_ver = buf[VERSION_LENGTH - 2]; - } - if (client_ver != CVERS_3_8 && client_ver != CVERS_3_7) { - /* only recognize 3.3, 3.7 & 3.8. Others dflt to 3.3 */ - client_ver = CVERS_3_3; + if (client_ver != CVERS_3_8 && client_ver != CVERS_3_7) { + /* only recognize 3.3, 3.7 & 3.8. Others dflt to 3.3 */ + client_ver = CVERS_3_3; + } + } else { + goto done; } /* 2a. Send security type */