RE: Linux recvfrom() broken (was: DNS problems)

Richard Letts (richard@illuin.demon.co.uk)
Tue, 18 Aug 1998 19:58:24 +0100 (BST)


On Tue, 18 Aug 1998, Dax Kelson wrote:

> On Tue, 18 Aug 1998, Paul A Vixie wrote:
>
> > > From: Greg Hudson <ghudson@MIT.EDU>
> > >
> > > To possibly clear up confusion: under Linux the recvfrom() return
> > > value is not limited to the size of the supplied buffer (which has
> > > caused some interesting bugs I've had to deal with), but under other
> > > systems it is. This situation is consistent with Dan's argument.
> >
> > then linux is, flatly, broken.

the manpage entry for solaris 2.5.1 is identical except it refers to
socket(3N) instead of socket(2).

recvfrom() returns the number of octets in the message, it does not
over-run the buffer supplied, but discards any octets that do not fit into
the buffer. In this way you know you know the reply over-ran the buffer
you supplied and you can do something about it.

RjL

-
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.altern.org/andrebalsa/doc/lkml-faq.html