From 8d0dad364ce72219ee86c912746d9930602c9475 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 16 Feb 2007 21:43:28 +0000 Subject: [PATCH] Conditionalize some ipv6 bits git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19168 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/locate_kdc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 57e2456b9..059a5c1c0 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -564,13 +564,19 @@ module_callback (void *cbdata, int socktype, struct sockaddr *sa) struct addrinfo ai; union { struct sockaddr_in sin; +#ifdef KRB5_USE_INET6 struct sockaddr_in6 sin6; +#endif } u; } *x; if (socktype != SOCK_STREAM && socktype != SOCK_DGRAM) return 0; - if (sa->sa_family != AF_INET && sa->sa_family != AF_INET6) + if (sa->sa_family != AF_INET +#ifdef KRB5_USE_INET6 + && sa->sa_family != AF_INET6 +#endif + ) return 0; x = malloc (sizeof (*x)); if (x == 0) { @@ -585,10 +591,12 @@ module_callback (void *cbdata, int socktype, struct sockaddr *sa) x->u.sin = *(struct sockaddr_in *)sa; x->ai.ai_addrlen = sizeof(struct sockaddr_in); } +#ifdef KRB5_USE_INET6 if (sa->sa_family == AF_INET6) { x->u.sin6 = *(struct sockaddr_in6 *)sa; x->ai.ai_addrlen = sizeof(struct sockaddr_in6); } +#endif if (add_addrinfo_to_list (d->lp, &x->ai, free, x) != 0) { /* Assumes only error is ENOMEM. */ d->out_of_mem = 1; -- 2.26.2