Skip to content

Commit

Permalink
camessage.c: Add note about trying to detection deprecated version
Browse files Browse the repository at this point in the history
using CA_PROTO_VERSION messages
  • Loading branch information
jesusvasquez333 committed Mar 10, 2021
1 parent 2ef15ed commit fdb498a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/database/src/ioc/rsrv/camessage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,15 @@ int camessage ( struct client *client )
pBody = ( void * ) ( mp + 1 );
}

/* ignore deprecated clients, but let newer clients identify themselves. */
/*
* ignore deprecated clients, but let newer clients identify themselves.
*
* 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 (client->proto==IPPROTO_TCP) {
/* log and error for too old clients, but keep the connection open to avoid a
Expand Down

0 comments on commit fdb498a

Please sign in to comment.