Subject RE: [firebird-support] Firebird 3.0.3 no longer compatible with InterBase 7.5.1 clients
Author FSPAPA INCA Team

I reckon this change to src/remote/server/server.cpp in commit 2fdb281759299f24d47349246f3c800ec78971cc introduced an unintended effect:

 

@@ -1715,11 +1814,8 @@ static bool accept_connection(rem_port* port, P_CNCT* connect, PACKET* send)

     for (const p_cnct::p_cnct_repeat* const end = protocol + connect->p_cnct_count;

           protocol < end; protocol++)

     {

-         if ((protocol->p_cnct_version == PROTOCOL_VERSION10 ||

-              protocol->p_cnct_version == PROTOCOL_VERSION11 ||

-              protocol->p_cnct_version == PROTOCOL_VERSION12 ||

-              protocol->p_cnct_version == PROTOCOL_VERSION13 ||

-              protocol->p_cnct_version == PROTOCOL_VERSION14) &&

+         if ((protocol->p_cnct_version >= PROTOCOL_VERSION10 &&

+              protocol->p_cnct_version <= PROTOCOL_VERSION15) &&

                 (protocol->p_cnct_architecture == arch_generic ||

                  protocol->p_cnct_architecture == ARCHITECTURE) &&

                protocol->p_cnct_weight >= weight)

 

 

The constants are defined in protocol.h:

 

const USHORT PROTOCOL_VERSION10  = 10;

// Since protocol 11 we must be separated from Borland Interbase.

// Therefore always set highmost bit in protocol version to 1.

// For unsigned protocol version this does not break version's compare.

const USHORT FB_PROTOCOL_FLAG = 0x8000;

const USHORT PROTOCOL_VERSION11  = (FB_PROTOCOL_FLAG | 11);

...

const USHORT PROTOCOL_VERSION15 = (FB_PROTOCOL_FLAG | 15);

 

 

So after the change above the version check accepts anything between 0x000a and 0x800f – ie legacy protocol version 10, or Firebird protocol 11-15, as well as any newer InterBase protocol versions.  If the list of protocol versions is getting a bit long to check each one individually, then how about something like the following?

 

        if ((protocol->p_cnct_version == PROTOCOL_VERSION10 ||

             (protocol->p_cnct_version >= PROTOCOL_VERSION11 &&

              protocol->p_cnct_version <= PROTOCOL_VERSION15)) &&

            (protocol->p_cnct_architecture == arch_generic ||

             protocol->p_cnct_architecture == ARCHITECTURE) &&

            protocol->p_cnct_weight >= weight)

 

 

 

 

From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com]
Sent: Thursday, 21 December 2017 10:15 AM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Firebird 3.0.3 no longer compatible with InterBase 7.5.1 clients

 

 

Hmm, that’s interesting thanks Mark… when connecting to a Firebird 3.0.1 server, I see this in mon$attachments (where mon$system_flag=0):

 

MON$REMOTE_PID MON$REMOTE_PROCESS        MON$REMOTE_PROTOCOL MON$REMOTE_VERSION

-------------- ------------------        ------------------- ------------------

<null>         <null>                    TCPv4               P10

23184          C:\Apps\fbclient\isql.exe TCPv4               P14

 

 

But when connecting to Firebird 3.0.2 (or 3.0.3 nightly… sorry about the confusion with version numbers there!) I see:

 

MON$REMOTE_PID MON$REMOTE_PROCESS        MON$REMOTE_PROTOCOL MON$REMOTE_VERSION

-------------- ------------------        ------------------- ------------------

<null>         <null>                    TCPv4               P14

19512          C:\Apps\fbclient\isql.exe TCPv4               P14

 

 

In each case the monitoring attachment is made using a Firebird client while an existing idle connection from InterBase 7.5.1 isql is open.  Firebird 3.0.1 reports the InterBase client as using protocol version 10, but Firebird 3.0.2 reports it as protocol version 14.

 

 

 

From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com]
Sent: Wednesday, 20 December 2017 10:40 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Firebird 3.0.3 no longer compatible with InterBase 7.5.1 clients

 

 

On 19-12-2017 21:06, Dimitry Sibiryakov sd@...
[firebird-support] wrote:

> 19.12.2017 4:32, FSPAPA INCA Team inca@... [firebird-support] wrote:
>> Wireshark traces show that the server is sending all the data from the query, but the
>> client is not recognising it and waits forever
>
> So, you, actually, should ask Embarcadero why their client cannot work with Firebird
> anymore.

Not necessarily, it could also mean that 3.0.3 has a change that breaks
protocol version 10.

--
Mark Rotteveel


Posted by: Mark Rotteveel <mark@...>

 

------------------------------------------------------------------------------------------------------------------------
Note:
This e-mail message has been inspected for malicious content.

Attention:
The information contained in this message and or attachments is intended only for the person
or entity to which it is addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the material from any system and
destroy any copies.
Please note that the views and opinions expressed in this message may be those of the
individual and not necessarily those of Foodstuffs South Island Ltd.

Thank you.
------------------------------------------------------------------------------------------------------------------------


Posted by: FSPAPA INCA Team <inca@...>

 

------------------------------------------------------------------------------------------------------------------------
Note:
This e-mail message has been inspected for malicious content.

Attention:
The information contained in this message and or attachments is intended only for the person
or entity to which it is addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the material from any system and
destroy any copies.
Please note that the views and opinions expressed in this message may be those of the
individual and not necessarily those of Foodstuffs South Island Ltd.

Thank you.
------------------------------------------------------------------------------------------------------------------------