Re: Bug with FIONREAD for TCP?

David S. Miller (davem@redhat.com)
Mon, 10 Apr 2000 02:07:02 -0700


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.

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

Later,
David S. Miller
davem@redhat.com

-
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/