This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12907] getaddrinfo() takes long time when lots of IP addresses are configured


http://sourceware.org/bugzilla/show_bug.cgi?id=12907

--- Comment #2 from david.hanisch at nsn dot com 2011-06-22 05:53:24 UTC ---
(In reply to comment #1)
Hello Ulrich,
Thanks for the reply, but from your comment I fear you might have got me wrong.
I will explain a bit more detailed and kindly ask you to check again.

The objective of the patch is not at all to keep or cache any data retrieved
from kernel between two calls to the function getaddrinfo().

The costly function in question is __check_pf(). It is currently called right
at the beginning of getaddrinfo(). The results are used in two conditions:
a) when flag AI_ADDRCONFIG is set 
b) when the number of found addresses is > 1

The patch just moves the call to __check_pf() from the beginning to the places
where the results are needed. Since there are two places the variable
"check_pf_called" is used as a flag to not call __check_pf() twice within one
call to getaddrinfo() in case a) and b) are true.

When converting a literal address like "1.2.3.4" neither a) nor b) is true, so
the call the __check_pf() is avoided.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]