David Malone wrote:
>
> I'm trying to figure out what #define I should use for the largest
> UDP datagram. The header files don't seem to define a constant for
> this. The correct size would seem to be 65535 'cos there are two
> bytes in the UDP header for the size.
>
> IP_MAXPACKET and IPV6_MAXPACKET are available and have the right
> values, but these don't really seem to be the correct thing to use
> 'cos they don't take headers or the possibility Jumbo payload into
> account.
To support jumbograms, I don't think you'll get around dynamic memory
allocation. (There is no reasonable upper bound for the buffer size.)
However, RFC2675 says:
The Jumbo Payload option is relevant only for IPv6 nodes that may be
attached to links with a link MTU greater than 65,575 octets (that
is, 65,535 + 40, where 40 octets is the size of the IPv6 header).
The Jumbo Payload option need not be implemented or understood by
IPv6 nodes that do not support attachment to links with MTU greater
than 65,575.
So it may be okay to punt on jumbograms for now, and use a 64K static
buffer like the patch in the PR does. Even if you do implement support for
jumbograms, I think keeping the 64K static buffer around as a "fast-path"
for the common case makes sense.
> I wanted to commit something for:
>
> http://www.FreeBSD.org/cgi/query-pr.cgi?pr=25050
>
> but I'm not convinced that the patch is spot on. I could determine
> the data size and malloc memory dynamically I guess.
--
Lars Eggert <[EMAIL PROTECTED]> Information Sciences Institute
http://www.isi.edu/larse/ University of Southern California
S/MIME Cryptographic Signature