Skip to content

Commit

Permalink
camessage.c: do not check if th client version is compatible, before
Browse files Browse the repository at this point in the history
receiving the version from the client
  • Loading branch information
jesusvasquez333 committed Mar 11, 2021
1 parent fdb498a commit 1bcf55e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/database/src/ioc/rsrv/camessage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2460,15 +2460,19 @@ int camessage ( struct client *client )
}

/*
* ignore deprecated clients, but let newer clients identify themselves.
* Ignore deprecated clients, but let newer clients identify themselves.
*
* If "client->minor_version_number" is 0, it means that we haven't received the minor
* version number from the client yet, so we don't check the version.
*
* Note: when the command is "CA_PROTO_VERSION", as that is the first message when creating a circuit
* "client->minor_version_number" will be 0, so we can not determine the protocol version using it.
* On the other hand, the header of a "CA_PROTO_VERSION" packet contains the minor protocol version
* number in the location of the "m_count" field which could be used, however that field is always 0
* for versions < CA_V49, so we can not rely that for detecting older, deprecated versions.
*/
if (msg.m_cmmd!=CA_PROTO_VERSION && !CA_VSUPPORTED(client->minor_version_number)) {
if (msg.m_cmmd!=CA_PROTO_VERSION && client->minor_version_number!=0 &&
!CA_VSUPPORTED(client->minor_version_number)) {
if (client->proto==IPPROTO_TCP) {
/* log and error for too old clients, but keep the connection open to avoid a
* re-connect loop.
Expand Down

0 comments on commit 1bcf55e

Please sign in to comment.