[Date Prev][Date Next] [Chronological] [Thread] [Top]

Bug: fragmented tcp stream not accepted (ITS#235)



Full_Name: David Olivier
Version: 1.2.3
OS: Solaris 2.6
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (159.84.44.142)


I've puzzled over this quite some time and finally decided it's a bug in slapd.

My would-be ldap client does not work. slapd closes connection immediately after
receiving the bindRequest.

The bindRequest I send is minimal:

30 0c 02 01 01 60 07 02 01 02 04 00 80 00

I've even gone to sniffing it off the network to check that this is what I
actually send.

What I see on the network is that these bytes are sent by my client in three
separate tcp frames:

 first frame: 30
second frame: 0c
 third frame: 02 01 01 60 07 02 01 02 04 00 80 00

If I send it in just one frame, with the following Java code:

    byte[] b = {
     (byte) 0x30, (byte) 0x0c,
      (byte) 0x02, (byte) 0x01, (byte) 0x01,
      (byte) 0x60, (byte) 0x07,
       (byte) 0x02, (byte) 0x01, (byte) 0x02,
       (byte) 0x04, (byte) 0x00,
       (byte) 0x80, (byte) 0x00
    };
    output.write(b); // in C, write(fildes, b, 14);

it works. But if I send slapd the same bytes, in three frames:

    byte[] b = {
     (byte) 0x30, (byte) 0x0c,
      (byte) 0x02, (byte) 0x01, (byte) 0x01,
      (byte) 0x60, (byte) 0x07,
       (byte) 0x02, (byte) 0x01, (byte) 0x02,
       (byte) 0x04, (byte) 0x00,
       (byte) 0x80, (byte) 0x00
    };
    output.write(b, 0, 1);  // C: write(fildes, b, 1);
    output.write(b, 1, 1);  // C: write(fildes, b+1, 1);
    output.write(b, 2, 12); // C: write(fildes, b+2, 12);

slapd closes the connection (after receiving the third frame, says snoop).

(To reproduce this you might need to add a sleep between the sends.)

Now am I not supposed to be allowed to send my stuff over the TCP connection as
I want to?