From: Miroslav Lichvar Date: Fri, 31 Jan 2014 16:06:08 +0000 (+0100) Subject: Merge branch '1.29-security' X-Git-Tag: 1.30-pre1~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc8a46363f398ff558be292628786f20e7ec4bcc;p=thirdparty%2Fchrony.git Merge branch '1.29-security' --- dc8a46363f398ff558be292628786f20e7ec4bcc diff --cc client.c index 467bfdd2,e0b3525a..1aaf714d --- a/client.c +++ b/client.c @@@ -1416,11 -1421,25 +1422,24 @@@ submit_request(CMD_Request *request, CM continue; } + #if PROTO_VERSION_NUMBER == 6 + /* Protocol version 5 is similar to 6 except there is no padding. + If a version 5 reply with STT_BADPKTVERSION is received, + switch our version and try again. */ + if (proto_version == PROTO_VERSION_NUMBER && + reply->version == PROTO_VERSION_NUMBER - 1) { + proto_version = PROTO_VERSION_NUMBER - 1; + continue; + } + #else + #error unknown compatibility with PROTO_VERSION - 1 + #endif + /* Good packet received, print out results */ #if 0 - printf("Reply cmd=%d reply=%d stat=%d num=%d tot=%d seq=%d utok=%08lx tok=%d\n", + printf("Reply cmd=%d reply=%d stat=%d seq=%d utok=%08lx tok=%d\n", ntohs(reply->command), ntohs(reply->reply), - ntohs(reply->status), ntohs(reply->number), - ntohs(reply->total), + ntohs(reply->status), ntohl(reply->sequence), ntohl(reply->utoken), ntohl(reply->token));