[Toybox] [PATCH] host: cope with large DNS responses.

enh enh at google.com
Sat Sep 7 15:05:05 PDT 2019


okay, attached is a version using dynamic allocation...



DNS responses were limited to 512 bytes back when they were UDP only,
but if you have a TCP connection you can get up to 64KiB.

Also use the existing constant for the size of rrname.

Also update the help text.

Also consistently use `sizeof(T)` rather than `sizeof T`.

Also use consistently use `ARRAY_LEN`.

Fixes #56.

Test: `toybox host value.testing.express`
---
 toys/pending/host.c | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

On Sat, Sep 7, 2019 at 12:09 AM Rob Landley <rob at landley.net> wrote:
>
> On 9/7/19 12:37 AM, enh via Toybox wrote:
> > DNS responses were limited to 512 bytes back when they were UDP only,
> > but if you have a TCP connection you can get up to 64KiB.
> >
> > Also use the existing constant for the size of rrname.
>
> I don't want that on the stack for nommu systems. (64k is a common nommu total
> process stack size, since it has to be a single contiguous allocation that is
> preallocated whether it's used or not.)
>
> As for maxdname, 4.3bsd had it as 256, it's currently 1025 (gratuitously NOT a
> power of 2?) and at that rate of growth I don't particularly want it on the
> stack either.
>
> Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-host-cope-with-large-DNS-responses.patch
Type: text/x-patch
Size: 4808 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20190907/e65fd55b/attachment-0003.bin>


More information about the Toybox mailing list