From db143ecacf966a580c0fedd21d413019d0ba0c99 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 23 Jun 2011 04:13:45 +0000 Subject: Use AI_ADDRCONFIG for more efficient getaddrinfo Add AI_ADDRCONFIG to the hint flags for every invocation of getaddrinfo which wasn't already using it. This is often the default behavior when no hints are specified, but we tend to specify hints a lot, so we have to say it ourselves. AI_ADDRCONFIG causes AAAA lookups to be skipped if the system has no public IPv6 interface addresses, usually saving a couple of DNS queries per getaddrinfo call and allowing DNS caching to be much more effective without the need for negative caching. ticket: 6923 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24978 dc483132-0cff-0310-8789-dd5450dbe970 --- src/plugins/locate/python/py-locate.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/locate/python') diff --git a/src/plugins/locate/python/py-locate.c b/src/plugins/locate/python/py-locate.c index 23b407c63..727302676 100644 --- a/src/plugins/locate/python/py-locate.c +++ b/src/plugins/locate/python/py-locate.c @@ -302,6 +302,7 @@ lookup(void *blob, enum locate_service_type svc, const char *realm, return -1; } aihints.ai_socktype = thissocktype; + aihints.ai_flags = AI_ADDRCONFIG; x = getaddrinfo (hoststr, portstr, &aihints, &airesult); if (x != 0) continue; -- cgit