2009-04-26 Aurelien Jarno * sysdeps/posix/getaddrinfo.c (rfc3484_sort): don't assign native result if the result has no associated interface. --- sysdeps/posix/getaddrinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -1455,13 +1455,13 @@ /* Fill in the results in all the records. */ for (int i = 0; i < src->nresults; ++i) - if (src->results[i].index == a1_index) + if (a1_index != -1 && src->results[i].index == a1_index) { assert (src->results[i].native == -1 || src->results[i].native == a1_native); src->results[i].native = a1_native; } - else if (src->results[i].index == a2_index) + else if (a2_index != -1 && src->results[i].index == a2_index) { assert (src->results[i].native == -1 || src->results[i].native == a2_native);