Re: UDP bugs

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Mon, 14 Dec 1998 14:23:03 +0000


On Mon, Dec 14, 1998 at 12:53:33PM +1100, Richard Gooch wrote:
> kuznet@ms2.inr.ac.ru writes:
> > rmem_max == 65535 by default.
> >
> > Taking into account 16 bytes of mac header and 4+alignment
> > for skb refcnt socket with default rmem_max can receive
> > only 65476 byte frames.
> >
> > So that, to play with such frames or with IPv6 jumbograms
> > rcvbuf must be increased. By user/admin, rather than by default,
> > certainly.
>
> Yes, I've just tried:
> int buflen = 65536 + 32;
> setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &buflen, sizeof buflen);
>
> and now I can send and receive packets with payload size of 65507
> bytes with Linux 2.1.126+.

I would have expected SO_RCVBUF to adjust the application-visible buffer
size for a UDP socket, the TCP window size for a TCP socket, and the raw
buffer size for a raw socket.

The reason I expect this is that an application dealing with a UDP
socket shouldn't have to know the UDP, IP and MAC header sizes. What if
you pass it a non-ethernet bound address, and IPV6 bound socket, some
other datagram type, an IP with source route, etc.?

So perhaps the SO_RCVBUF sockopt should be changed to reflect this?
Or another sockopt, SO_APPRCVBUF?

-- Jamie

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