summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-06-23 04:13:45 +0000
committerGreg Hudson <ghudson@mit.edu>2011-06-23 04:13:45 +0000
commitdb143ecacf966a580c0fedd21d413019d0ba0c99 (patch)
tree5f269985aac25d4963d1a13dd97ab5f6fcf6a907 /src/plugins
parentbc8594e7c388c8a5cfb9516a0980877cb1321d32 (diff)
downloadkrb5-db143ecacf966a580c0fedd21d413019d0ba0c99.tar.gz
krb5-db143ecacf966a580c0fedd21d413019d0ba0c99.tar.xz
krb5-db143ecacf966a580c0fedd21d413019d0ba0c99.zip
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
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/locate/python/py-locate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/locate/python/py-locate.c b/src/plugins/locate/python/py-locate.c
index 23b407c633..7273026760 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;