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/kadmin/dbutil/kadm5_create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kadmin') diff --git a/src/kadmin/dbutil/kadm5_create.c b/src/kadmin/dbutil/kadm5_create.c index 65cd68be5..9d5ee1da4 100644 --- a/src/kadmin/dbutil/kadm5_create.c +++ b/src/kadmin/dbutil/kadm5_create.c @@ -184,7 +184,7 @@ static int add_admin_princs(void *handle, krb5_context context, char *realm) goto clean_and_exit; } memset(&ai_hints, 0, sizeof(ai_hints)); - ai_hints.ai_flags = AI_CANONNAME; + ai_hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG; gai_error = getaddrinfo(localname, (char *)NULL, &ai_hints, &ai); if (gai_error) { ret = EINVAL; -- cgit