Re: Bug with FIONREAD for TCP?

From: Richard Gooch (rgooch@ras.ucalgary.ca)
Date: Mon Apr 10 2000 - 09:29:03 EST


David S. Miller writes:
> Date: Mon, 10 Apr 2000 00:15:20 -0600
> From: Richard Gooch <rgooch@ras.ucalgary.ca>
>
> Hi, all. For at least a month or two I've noticed that FIONREAD
> yields 1 byte on a freshly closed TCP connection, rather than 0.
>
> The server creates a socket, binds to a port and listens and
> accepts the first connection. It does a select(2) on the FD, and
> upon an input event, calls ioctl(2) with FIONREAD. This yields 1
> byte readable. Any attempt to read that byte fails, as it's not
> really there.
>
> It's the sequence byte taken up by the initial SYN. It's probably
> wrong.

Mmm...

> I don't know if other systems report it this way too, do you have a
> way to check this out?

I've been using this technique for nearly 10 years, and FIONREAD has
always yielded 0 bytes readable on close for ConvexOS, SunOS 4.x,
Solaris 2.x, IRIX 5.x and 6.x, AIX 3.x, HP-UX ?.?, UNICOS ?.?, Ultrix,
DEC OSF/1 (aka Digital Unix aka Tru64 Unix aka tomorrow's new name).
Even Linux worked this way, until sometime in the last 4 months, while
I was away (2.3.x series of course).

If you mean: do I have a test programme, then yes. I'll post that if
you want.

                                Regards,

                                        Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:14 EST