[PATCH v3] [BZ #11438] getaddrinfo: map RFC 1918 addresses to global scope

Jeff Law law@redhat.com
Fri Sep 28 16:15:00 GMT 2012


On 09/26/2012 06:16 PM, Dmitry V. Levin wrote:
> On Tue, Sep 25, 2012 at 03:43:23PM -0400, Carlos O'Donell wrote:
> [...]
>> Is it possible to add a test-case for this to prevent a regression and
>> further validate the changes do what we expect?
>
> It depends on what exactly is needed to be tested for regressions.
>
> It's relatively easy to extend tst-rfc3484.c with a check that 10/8,
> 172.16/12 and 192.168/16 are in the same scope as 192.0.2/24, e.g.:
>
> diff --git a/posix/tst-rfc3484.c b/posix/tst-rfc3484.c
> index 29e1461..db3ae1b 100644
> --- a/posix/tst-rfc3484.c
> +++ b/posix/tst-rfc3484.c
> @@ -71,6 +71,9 @@ service_user *__nss_hosts_database attribute_hidden;
>
>   struct sockaddr_in addrs[] =
>   {
> +  { .sin_family = AF_INET, .sin_addr = { h (0x0aa85f19) } },
> +  { .sin_family = AF_INET, .sin_addr = { h (0xac105f19) } },
> +  { .sin_family = AF_INET, .sin_addr = { h (0xc0000219) } },
>     { .sin_family = AF_INET, .sin_addr = { h (0xc0a86d1d) } },
>     { .sin_family = AF_INET, .sin_addr = { h (0xc0a85d03) } },
>     { .sin_family = AF_INET, .sin_addr = { h (0xc0a82c3d) } },
> @@ -86,7 +89,7 @@ static size_t order[naddrs];
>
>   static int expected[naddrs] =
>     {
> -    6, 1, 0, 3, 2, 4, 5
> +    9, 4, 3, 6, 5, 7, 8, 2, 0, 1
>     };
I've applied the fix & testsuite change.   Thanks for pushing this issue 
forward Dmitry.

Jeff



More information about the Libc-alpha mailing list