[PATCH] Fix multiple DNS queries when negative results returned

Ricard Wanderlof ricard.wanderlof at axis.com
Fri Jun 27 13:56:53 UTC 2008


On Fri, 27 Jun 2008, Bernhard Fischer wrote:

>> Index: libc/inet/resolv.c
>> ===================================================================
>> --- libc/inet/resolv.c        (revision 22530)
>> +++ libc/inet/resolv.c        (working copy)
>> @@ -757,6 +757,7 @@
>>  #ifdef __UCLIBC_HAS_IPV4__
>>       struct sockaddr_in sa;
>>  #endif
>> +     bool negative_results[MAX_SEARCH + 1] = { 0 };
>
> unsigned no_results;
> if (got negative result)
>  no_results |= (1 << variant)
>
> Which one is smaller? size(1), please.

They are the same.

With my configuration, size lib/libuClibc-0.9.29.so returns:

    text    data     bss     dec     hex filename
  274873    5016   14376  294265   47d79 lib/libuClibc-0.9.29.so

no matter whether I apply the patch as submitted, or use a bitmapped 
version. (Removing the off-the-end-of-the-array tests in the array version 
yields 20 bytes less; these tests aren't needed in the bitmapped version 
of course).

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the uClibc mailing list