michael@700: --- src/sub-func.c.orig 2003-03-19 13:28:15.000000000 +0100 michael@700: +++ src/sub-func.c 2003-07-28 10:35:53.000000000 +0200 michael@700: @@ -1267,7 +1267,7 @@ michael@700: } michael@700: #endif michael@700: michael@700: -#if defined(HAVE_GETHOSTBYNAME2) && defined(HAVE_INET_NTOP) michael@700: +#if defined(HAVE_GETHOSTBYNAME2) && defined(HAVE_INET_NTOP) && defined(AF_INET6) michael@700: char * michael@700: _resolv_v6_ghbn2 (char *raddr, struct dnsresp *d_resp, char *extra) michael@700: { michael@700: @@ -1308,7 +1308,7 @@ michael@700: } michael@700: #endif michael@700: michael@700: -#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) michael@700: +#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) && defined(AF_INET6) michael@700: char * michael@700: _resolv_v6_gai (char *raddr, struct dnsresp *d_resp, char *extra) michael@700: { michael@700: @@ -1393,13 +1393,19 @@ michael@700: snprintf(d_resp->str, 127, "%s%s", inet_ntoa (sin->sin_addr), extra); michael@700: d_resp->type = AF_INET; michael@700: } michael@700: +#ifdef AF_INET6 michael@700: if (res->ai_family == PF_INET6) { michael@700: sin6 = (struct sockaddr_in6 *) res->ai_addr; michael@700: snprintf (retaddr, 1023, "%s%s", inet_ntop (AF_INET6, &sin6->sin6_addr, ip6addr, 128), extra); michael@700: snprintf (d_resp->str, 127, "%s%s", inet_ntop (AF_INET6, &sin6->sin6_addr, ip6addr, 128), extra); michael@700: d_resp->type = AF_INET6; michael@700: } michael@700: +#endif michael@700: +#ifdef AF_INET6 michael@700: if (res->ai_next && (res->ai_family == PF_INET || res->ai_family == PF_INET6)) michael@700: +#else michael@700: + if (res->ai_next && res->ai_family == PF_INET) michael@700: +#endif michael@700: d_resp = new_dnsresp (d_resp); michael@700: res = res->ai_next; michael@700: } michael@700: @@ -1460,14 +1466,20 @@ michael@700: if ((f_gethostbyname2 || f_getaddrinfo) && f_inet_ntop) michael@700: ipv6_cap = 1; michael@700: michael@700: +#ifdef AF_INET6 michael@700: if (family != PF_INET && family != PF_INET6 && family != PF_UNSPEC) michael@700: +#else michael@700: + if (family != PF_INET && family != PF_UNSPEC) michael@700: +#endif michael@700: return NULL; michael@700: michael@700: if (family == PF_INET && !ipv4_cap) michael@700: return NULL; michael@700: michael@700: +#ifdef AF_INET6 michael@700: if (family == PF_INET6 && !ipv6_cap) michael@700: return NULL; michael@700: +#endif michael@700: michael@700: if (family == PF_UNSPEC && (!ipv4_cap && !ipv6_cap)) michael@700: return NULL; michael@700: @@ -1475,8 +1487,10 @@ michael@700: if (strlen (addr) > 1023) michael@700: return NULL; michael@700: michael@700: +#ifdef AF_INET6 michael@700: if (family == PF_UNSPEC && !ipv4_cap) michael@700: family = PF_INET6; michael@700: +#endif michael@700: michael@700: if (family == PF_UNSPEC && !ipv6_cap) michael@700: family = PF_INET; michael@700: @@ -1508,6 +1522,7 @@ michael@700: return retaddr; michael@700: } michael@700: michael@700: +#ifdef AF_INET6 michael@700: if (family == PF_INET6) { michael@700: if (f_getaddrinfo) { michael@700: tmpstr = _resolv_v6_gai (raddr, d_resp, extra); michael@700: @@ -1525,6 +1540,7 @@ michael@700: return retaddr; michael@700: } michael@700: } michael@700: +#endif michael@700: michael@700: if (family == PF_UNSPEC) { michael@700: if (f_getaddrinfo) { michael@700: --- src/sub.c.orig 2003-03-19 13:28:16.000000000 +0100 michael@700: +++ src/sub.c 2003-07-28 10:37:10.000000000 +0200 michael@700: @@ -496,6 +496,7 @@ michael@700: ifarg_cur->type = IFT_V6; michael@700: } michael@700: michael@700: +#if AF_INET6 michael@700: if (abox->type == AT_V6 && abox->resolv) { michael@700: d_resp_start = d_resp_cur = (struct dnsresp *) malloc (sizeof (struct dnsresp)); michael@700: d_resp_start->next = NULL; michael@700: @@ -526,6 +527,7 @@ michael@700: michael@700: free_dnsresp (d_resp_start); michael@700: } michael@700: +#endif michael@700: michael@700: if (abox->type == AT_INT) { michael@700: if_cur = if_start; michael@700: @@ -585,12 +587,14 @@ michael@700: d_resp_cur = d_resp_start; michael@700: while (d_resp_cur) { michael@700: strncpy (ifarg_cur->cmdstr, abox->str, 127); michael@700: +#if AF_INET6 michael@700: if (d_resp_cur->type == AF_INET6) { michael@700: strncpy (ifarg_cur->p_v6addr, d_resp_cur->str, 43); michael@700: ifarg_cur->type = IFT_V6; michael@700: michael@700: mk_ipv6addr (&ifarg_cur->v6ad, ifarg_cur->p_v6addr); michael@700: } michael@700: +#endif michael@700: if (d_resp_cur->type == AF_INET) { michael@700: tmpstr = strstr (d_resp_cur->str, " "); michael@700: if (tmpstr != NULL && (strlen (tmpstr) > 0)) {